2012-12-11 21:08:15 +00:00
|
|
|
#
|
|
|
|
# W A R N I N G
|
|
|
|
# -------------
|
|
|
|
#
|
|
|
|
# This file is not part of the Qt API. It exists purely as an
|
|
|
|
# implementation detail. It may change from version to version
|
|
|
|
# without notice, or even be removed.
|
|
|
|
#
|
|
|
|
# We mean it.
|
|
|
|
#
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2013-02-25 14:42:06 +00:00
|
|
|
load(cmake_functions)
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2013-02-11 12:59:34 +00:00
|
|
|
# Several distros (ArchLinux, Fedora) have in the past installed libraries
|
|
|
|
# in /lib(64)?, but are now moving to install libraries in /usr/lib(64)?/.
|
|
|
|
# The /lib paths are made symlinks to the /usr/lib paths. If someone searching
|
|
|
|
# for a Qt 5 package finds it in /lib/cmake/Qt5Core, although it has been
|
|
|
|
# installed in /usr/lib/cmake/Qt5Core, relative paths to the includes and
|
2013-04-17 12:55:36 +00:00
|
|
|
# executables will not work.
|
|
|
|
# To work around this, we insert code into the generated config files to check
|
|
|
|
# at cmake time whether package has been found via a symlink, and correct
|
|
|
|
# that to an absolute path. This is only done for installations to
|
|
|
|
# the /usr or / prefix.
|
|
|
|
CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$[QT_INSTALL_LIBS])
|
|
|
|
contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND = $$CMAKE_INSTALL_LIBS_DIR
|
2013-02-11 12:59:34 +00:00
|
|
|
|
2015-04-15 11:59:39 +00:00
|
|
|
CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake
|
|
|
|
|
2019-06-20 13:26:39 +00:00
|
|
|
internal_module {
|
|
|
|
MODULE = "$${MODULE}_private"
|
|
|
|
}
|
|
|
|
|
2019-03-07 10:11:54 +00:00
|
|
|
# Core, Network, an external module named Foo
|
2013-09-04 20:01:47 +00:00
|
|
|
CMAKE_MODULE_NAME = $$cmakeModuleName($${MODULE})
|
|
|
|
|
2019-03-07 10:11:54 +00:00
|
|
|
# QtCore, QtNetwork, still Foo
|
|
|
|
CMAKE_INCLUDE_NAME = $$eval(QT.$${MODULE}.name)
|
|
|
|
|
|
|
|
# TARGET here is the one changed at the end of qt_module.prf,
|
|
|
|
# which already contains the Qt5 prefix and QT_LIBINFIX suffix :
|
2019-06-19 15:43:19 +00:00
|
|
|
# Qt5Core_{libinfix_suffix}, Qt5Network_{libinfix_suffix}, Foo_{libinfix_suffix}
|
|
|
|
# (or QtCore_{libinfix_suffix}, Foo_{libinfix_suffix} on macos with -framework).
|
2019-03-07 10:11:54 +00:00
|
|
|
CMAKE_QT_STEM = $${TARGET}
|
|
|
|
|
2019-08-28 15:51:46 +00:00
|
|
|
# ANDROID_ABI is set by the android toolchain file, see https://developer.android.com/ndk/guides/cmake
|
|
|
|
android: CMAKE_QT_STEM = $$replace(CMAKE_QT_STEM, "_$${QT_ARCH}", '_\$\{ANDROID_ABI\}')
|
|
|
|
|
2019-06-19 15:43:19 +00:00
|
|
|
# On macOS when building just a debug configuration which is not part of debug_and_release,
|
|
|
|
# $${TARGET} already contains a _debug suffix, as per the following call chain:
|
|
|
|
# qt_module.prf -> qt5LibraryTarget -> qtLibraryTarget -> qtPlatformTargetSuffix.
|
|
|
|
# Remove the _debug suffix in the stem, to keep all further uses of CMAKE_QT_STEM consistent.
|
|
|
|
# The _debug suffix is then re-added where needed regardless if it's a debug_and_release build
|
|
|
|
# or just debug.
|
|
|
|
darwin:!qt_framework:!debug_and_release:CONFIG(debug, debug|release) {
|
|
|
|
CMAKE_QT_STEM = $$replace(CMAKE_QT_STEM, _debug$, )
|
|
|
|
}
|
|
|
|
|
2018-04-25 10:48:21 +00:00
|
|
|
!generated_privates {
|
|
|
|
isEmpty(SYNCQT.INJECTED_PRIVATE_HEADER_FILES):isEmpty(SYNCQT.PRIVATE_HEADER_FILES): \
|
|
|
|
CMAKE_NO_PRIVATE_INCLUDES = true
|
|
|
|
}
|
2013-09-04 20:01:47 +00:00
|
|
|
split_incpath {
|
|
|
|
CMAKE_ADD_SOURCE_INCLUDE_DIRS = true
|
|
|
|
CMAKE_SOURCE_INCLUDES = \
|
2019-03-07 10:11:54 +00:00
|
|
|
$$cmakeTargetPaths($$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/$${CMAKE_INCLUDE_NAME})
|
2013-09-04 20:01:47 +00:00
|
|
|
CMAKE_SOURCE_PRIVATE_INCLUDES = \
|
2019-03-07 10:11:54 +00:00
|
|
|
$$cmakeTargetPaths($$QT_MODULE_INCLUDE_BASE/$${CMAKE_INCLUDE_NAME}/$$eval(QT.$${MODULE}.VERSION) \
|
|
|
|
$$QT_MODULE_INCLUDE_BASE/$${CMAKE_INCLUDE_NAME}/$$eval(QT.$${MODULE}.VERSION)/$${CMAKE_INCLUDE_NAME})
|
2013-10-15 21:18:44 +00:00
|
|
|
|
|
|
|
cmake_extra_source_includes.input = $$PWD/data/cmake/ExtraSourceIncludes.cmake.in
|
2015-04-15 11:59:39 +00:00
|
|
|
cmake_extra_source_includes.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/ExtraSourceIncludes.cmake
|
2013-10-15 21:18:44 +00:00
|
|
|
|
|
|
|
!build_pass:QMAKE_SUBSTITUTES += \
|
|
|
|
cmake_extra_source_includes
|
|
|
|
|
|
|
|
cmake_qt5_module_files.files = \
|
|
|
|
$$cmake_extra_source_includes.output
|
2013-09-04 20:01:47 +00:00
|
|
|
}
|
|
|
|
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_INCLUDE_DIR = $$cmakeRelativePath($$[QT_INSTALL_HEADERS], $$[QT_INSTALL_PREFIX])
|
2013-04-17 12:55:36 +00:00
|
|
|
contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") {
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_INCLUDE_DIR = $$[QT_INSTALL_HEADERS]/
|
2012-02-27 15:45:27 +00:00
|
|
|
CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
|
|
|
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
|
2013-04-17 12:55:36 +00:00
|
|
|
contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_LIB_DIR = $$[QT_INSTALL_LIBS]/
|
|
|
|
CMAKE_LIB_DIR_IS_ABSOLUTE = True
|
|
|
|
} else {
|
2013-08-30 14:09:06 +00:00
|
|
|
CMAKE_RELATIVE_INSTALL_LIBS_DIR = $$cmakeRelativePath($$[QT_INSTALL_PREFIX], $$[QT_INSTALL_LIBS])
|
2012-02-27 15:45:27 +00:00
|
|
|
# We need to go up another two levels because the CMake files are
|
|
|
|
# installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
|
2013-08-30 14:09:06 +00:00
|
|
|
CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}../../"
|
2012-02-27 15:45:27 +00:00
|
|
|
}
|
|
|
|
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
|
2013-04-17 12:55:36 +00:00
|
|
|
contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
|
2013-01-18 14:30:56 +00:00
|
|
|
CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
|
2012-02-27 15:45:27 +00:00
|
|
|
CMAKE_BIN_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
|
|
|
|
2013-08-15 14:45:23 +00:00
|
|
|
CMAKE_PLUGIN_DIR = $$cmakeRelativePath($$[QT_INSTALL_PLUGINS], $$[QT_INSTALL_PREFIX])
|
|
|
|
contains(CMAKE_PLUGIN_DIR, "^\\.\\./.*") {
|
|
|
|
CMAKE_PLUGIN_DIR = $$[QT_INSTALL_PLUGINS]/
|
|
|
|
CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
|
|
|
|
2016-03-09 13:59:20 +00:00
|
|
|
win32:!static:!staticlib {
|
2013-06-12 12:57:11 +00:00
|
|
|
CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX])
|
|
|
|
contains(CMAKE_DLL_DIR, "^\\.\\./.*") {
|
|
|
|
CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/
|
|
|
|
CMAKE_DLL_DIR_IS_ABSOLUTE = True
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
|
|
|
|
CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
|
|
|
|
}
|
|
|
|
|
2012-02-02 21:40:30 +00:00
|
|
|
static|staticlib:CMAKE_STATIC_TYPE = true
|
|
|
|
|
2019-06-20 13:26:39 +00:00
|
|
|
internal_module {
|
|
|
|
CMAKE_INTERNAL_MODULE = true
|
|
|
|
}
|
|
|
|
|
2013-08-19 09:31:50 +00:00
|
|
|
CMAKE_DEBUG_TYPE =
|
|
|
|
CMAKE_RELEASE_TYPE =
|
|
|
|
|
|
|
|
# Requirements:
|
|
|
|
# * If Qt is configured with -debug, we're creating debug libraries and not
|
|
|
|
# release libraries, regardless of whether we're on a platform where
|
|
|
|
# debug_and_release is true.
|
|
|
|
# * If Qt is configured with -release, we're creating release libraries and not
|
|
|
|
# debug libraries, regardless of whether we're on a platform where
|
|
|
|
# debug_and_release is true.
|
|
|
|
# * If Qt is configured with neither -debug nor -release, and we are on a
|
|
|
|
# platform where debug_and_release is true, we're creating both
|
|
|
|
# debug and release libraries.
|
|
|
|
# * If Qt is configured with -debug on a platform where debug_and_release is
|
|
|
|
# true, and 'make release' is subsequently invoked, CMake is only aware of
|
|
|
|
# the debug libraries at build time.
|
|
|
|
|
|
|
|
equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
|
2019-08-22 09:09:45 +00:00
|
|
|
if(debug_and_release:build_all)|CONFIG(debug, debug|release): CMAKE_DEBUG_TYPE = debug
|
|
|
|
if(debug_and_release:build_all)|CONFIG(release, debug|release): CMAKE_RELEASE_TYPE = release
|
2013-08-19 09:31:50 +00:00
|
|
|
|
2019-06-20 10:04:31 +00:00
|
|
|
# CMAKE_DEBUG_AND_RELEASE is used to tell the _populate_$${CMAKE_MODULE_NAME}_target_properties
|
|
|
|
# functions whether a Configuration specific generator expression needs to be added to the values
|
|
|
|
# of INTERFACE_LINK_LIBRARIES and INTERFACE_LINK_OPTIONS. For debug_and_release builds, we do need
|
|
|
|
# configuration specific values. For singular builds (only release or only debug), we want the
|
|
|
|
# values to be applied regardless of the configuration.
|
|
|
|
# This would allow on Linux and macOS (and with a recent enough version of CMake on Windows) to
|
|
|
|
# build a Debug configuration of an application, even if Qt was built in a Release configuration.
|
|
|
|
#
|
|
|
|
# All IMPORTED_LOCATION_<CONFIG> paths are automatically considered by CMake if there is no
|
|
|
|
# <CONFIG> equivalent to the value specified by CMAKE_BUILD_TYPE.
|
|
|
|
# This means that when Qt was built in a Release configuration, and the application in a Debug
|
|
|
|
# configuration, IMPORTED_LOCATION_RELEASE will be used for the Qt libraries.
|
2019-08-23 08:41:17 +00:00
|
|
|
#
|
|
|
|
# Note that we need to check for the "debug_and_release" feature, and not the CONFIG value, because
|
|
|
|
# the CONFIG value is always set to true on Windows in msvc-desktop.conf disregarding whether the
|
|
|
|
# configure line specified just -debug or just -release.
|
|
|
|
# This also means that if a user configures and builds Qt with -release, and then calls nmake debug
|
|
|
|
# to build debug libraries of Qt, the generated CMake file won't know about debug libraries,
|
|
|
|
# and will always link against the release libraries.
|
|
|
|
qtConfig(debug_and_release) {
|
2019-06-20 10:04:31 +00:00
|
|
|
CMAKE_DEBUG_AND_RELEASE = TRUE
|
|
|
|
} else {
|
|
|
|
CMAKE_DEBUG_AND_RELEASE = FALSE
|
|
|
|
}
|
|
|
|
|
2013-08-15 14:45:23 +00:00
|
|
|
contains(CONFIG, plugin) {
|
2018-10-17 20:03:28 +00:00
|
|
|
equals(PLUGIN_EXTENDS, -) {
|
|
|
|
CMAKE_PLUGIN_EXTENDS = -
|
2014-04-02 20:19:01 +00:00
|
|
|
} else {
|
2018-10-17 20:03:28 +00:00
|
|
|
list_plugin_extends =
|
|
|
|
for (p, PLUGIN_EXTENDS) {
|
|
|
|
m = $$cmakeModuleName($$p)
|
|
|
|
list_plugin_extends += Qt5::$$m
|
2013-10-23 10:40:05 +00:00
|
|
|
}
|
2018-10-17 20:03:28 +00:00
|
|
|
CMAKE_PLUGIN_EXTENDS = $$join(list_plugin_extends, ";")
|
2013-10-23 10:40:05 +00:00
|
|
|
}
|
2013-08-15 14:45:23 +00:00
|
|
|
|
2018-10-17 20:03:28 +00:00
|
|
|
PLUGIN_MODULE_NAME =
|
|
|
|
unique_qt_modules = $$unique(QT_MODULES) # In case modules appear in multiple places
|
|
|
|
for (mod, unique_qt_modules) {
|
|
|
|
contains(QT.$${mod}.plugin_types, $$PLUGIN_TYPE) {
|
|
|
|
!isEmpty(PLUGIN_MODULE_NAME): \
|
|
|
|
error("Multiple modules claim plugin type '$$PLUGIN_TYPE' ($$mod, in addition to $$PLUGIN_MODULE_NAME)")
|
|
|
|
PLUGIN_MODULE_NAME = $$mod
|
|
|
|
}
|
|
|
|
}
|
|
|
|
isEmpty(PLUGIN_MODULE_NAME): error("No module claims plugin type '$$PLUGIN_TYPE'")
|
|
|
|
|
|
|
|
sorted_deps = $$sort_depends(QT_PLUGIN.$${CMAKE_QT_STEM}.DEPENDS, QT.)
|
|
|
|
mod_deps =
|
|
|
|
lib_deps =
|
|
|
|
aux_mod_deps =
|
|
|
|
aux_lib_deps =
|
|
|
|
for (dep, sorted_deps) {
|
|
|
|
cdep = $$cmakeModuleName($$dep)
|
|
|
|
mod_deps += $$cdep
|
|
|
|
lib_deps += Qt5::$$cdep
|
|
|
|
}
|
|
|
|
CMAKE_PLUGIN_MODULE_DEPS = $$join(mod_deps, ";")
|
|
|
|
CMAKE_PLUGIN_QT5_MODULE_DEPS = $$join(lib_deps, ";")
|
|
|
|
|
2013-08-15 14:45:23 +00:00
|
|
|
CMAKE_MODULE_NAME = $$cmakeModuleName($$PLUGIN_MODULE_NAME)
|
|
|
|
|
|
|
|
CMAKE_PLUGIN_NAME = $$PLUGIN_CLASS_NAME
|
2018-10-17 20:03:28 +00:00
|
|
|
CMAKE_PLUGIN_TYPE = $$PLUGIN_TYPE
|
|
|
|
CMAKE_PLUGIN_TYPE_ESCAPED = $$replace(PLUGIN_TYPE, [-/], _)
|
2013-08-15 14:45:23 +00:00
|
|
|
|
|
|
|
win32 {
|
2014-09-23 16:36:28 +00:00
|
|
|
isEmpty(CMAKE_STATIC_TYPE) {
|
2018-10-17 20:03:28 +00:00
|
|
|
CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.dll
|
|
|
|
CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.dll
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl
|
2014-09-23 16:36:28 +00:00
|
|
|
} else:mingw {
|
2018-10-17 20:03:28 +00:00
|
|
|
CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.a
|
|
|
|
CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}d.a
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}d.prl
|
2014-09-23 16:36:28 +00:00
|
|
|
} else { # MSVC static
|
2018-10-17 20:03:28 +00:00
|
|
|
CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.lib
|
|
|
|
CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.lib
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl
|
2014-09-23 16:36:28 +00:00
|
|
|
}
|
2013-08-15 14:45:23 +00:00
|
|
|
} else {
|
|
|
|
mac {
|
2018-10-17 20:03:28 +00:00
|
|
|
isEmpty(CMAKE_STATIC_TYPE): CMAKE_PLUGIN_EXT = .dylib
|
|
|
|
else: CMAKE_PLUGIN_EXT = .a
|
2013-09-13 13:55:39 +00:00
|
|
|
|
2018-10-17 20:03:28 +00:00
|
|
|
CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}$${CMAKE_PLUGIN_EXT}
|
|
|
|
CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}_debug$${CMAKE_PLUGIN_EXT}
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}_debug.prl
|
2013-08-15 14:45:23 +00:00
|
|
|
} else {
|
2018-10-17 20:03:28 +00:00
|
|
|
isEmpty(CMAKE_STATIC_TYPE): CMAKE_PLUGIN_EXT = .so
|
|
|
|
else: CMAKE_PLUGIN_EXT = .a
|
2013-09-13 13:55:39 +00:00
|
|
|
|
2018-10-17 20:03:28 +00:00
|
|
|
CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}$${CMAKE_PLUGIN_EXT}
|
|
|
|
CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}$${CMAKE_PLUGIN_EXT}
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.prl
|
2013-08-15 14:45:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
cmake_target_file.input = $$PWD/data/cmake/Qt5PluginTarget.cmake.in
|
2015-04-15 11:59:39 +00:00
|
|
|
cmake_target_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}_$${PLUGIN_CLASS_NAME}.cmake
|
2018-10-17 20:03:28 +00:00
|
|
|
cmake_qt5_plugin_import_file.input = $$PWD/data/cmake/Qt5ImportPlugin.cpp.in
|
|
|
|
cmake_qt5_plugin_import_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}_$${PLUGIN_CLASS_NAME}_Import.cpp
|
2013-08-15 14:45:23 +00:00
|
|
|
|
2018-10-17 20:03:28 +00:00
|
|
|
!build_pass {
|
|
|
|
QMAKE_SUBSTITUTES += cmake_target_file
|
|
|
|
static|staticlib: QMAKE_SUBSTITUTES += cmake_qt5_plugin_import_file
|
|
|
|
}
|
2013-08-15 14:45:23 +00:00
|
|
|
|
|
|
|
cmake_qt5_plugin_file.files = $$cmake_target_file.output
|
2018-10-17 20:03:28 +00:00
|
|
|
static|staticlib: cmake_qt5_plugin_file.files += $$cmake_qt5_plugin_import_file.output
|
2013-08-15 14:45:23 +00:00
|
|
|
cmake_qt5_plugin_file.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
|
|
|
|
INSTALLS += cmake_qt5_plugin_file
|
|
|
|
|
|
|
|
return()
|
|
|
|
}
|
|
|
|
|
2012-10-29 14:16:51 +00:00
|
|
|
CMAKE_MKSPEC = $$[QMAKE_XSPEC]
|
2012-10-15 15:15:41 +00:00
|
|
|
|
2015-04-13 21:33:24 +00:00
|
|
|
sorted_deps = $$sort_depends(QT.$${MODULE}.depends, QT.)
|
|
|
|
mod_deps =
|
|
|
|
lib_deps =
|
|
|
|
aux_mod_deps =
|
|
|
|
aux_lib_deps =
|
|
|
|
# Until CMake 3.0 is the minimum requirement of Qt 5, we need to filter
|
|
|
|
# out header-only modules from dependencies. CMake 3.0 provides INTERFACE
|
|
|
|
# libraries which are equivalent to header-only modules.
|
|
|
|
for (dep, sorted_deps) {
|
|
|
|
cdep = $$cmakeModuleName($$dep)
|
|
|
|
!contains(QT.$${dep}.module_config, no_link) {
|
|
|
|
mod_deps += $$cdep
|
|
|
|
lib_deps += Qt5::$$cdep
|
|
|
|
} else {
|
|
|
|
aux_mod_deps += $$cdep
|
|
|
|
aux_lib_deps += Qt5::$$cdep
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CMAKE_MODULE_DEPS = $$join(mod_deps, ";")
|
|
|
|
CMAKE_QT5_MODULE_DEPS = $$join(lib_deps, ";")
|
|
|
|
CMAKE_INTERFACE_MODULE_DEPS = $$join(aux_mod_deps, ";")
|
|
|
|
CMAKE_INTERFACE_QT5_MODULE_DEPS = $$join(aux_lib_deps, ";")
|
2018-10-17 20:03:28 +00:00
|
|
|
CMAKE_MODULE_PLUGIN_TYPES = $$join(QT.$${MODULE}.plugin_types, ";")
|
2013-08-19 09:31:50 +00:00
|
|
|
|
2013-03-02 14:46:37 +00:00
|
|
|
mac {
|
2012-07-20 10:39:09 +00:00
|
|
|
!isEmpty(CMAKE_STATIC_TYPE) {
|
2019-06-19 15:43:19 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.a
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
|
2012-08-21 11:12:57 +00:00
|
|
|
|
2019-06-19 15:43:19 +00:00
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.prl
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
|
2011-11-01 13:59:23 +00:00
|
|
|
} else {
|
2016-06-27 08:56:50 +00:00
|
|
|
qt_framework {
|
2019-09-10 14:37:45 +00:00
|
|
|
# Intentionally there is no '_debug' infix for framework builds.
|
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}
|
2019-03-07 10:11:54 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}
|
2012-07-20 10:39:09 +00:00
|
|
|
CMAKE_BUILD_IS_FRAMEWORK = "true"
|
2011-12-16 23:47:13 +00:00
|
|
|
} else {
|
2019-06-19 15:43:19 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.$$eval(QT.$${MODULE}.VERSION).dylib
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.$$eval(QT.$${MODULE}.VERSION).dylib
|
2011-12-16 23:47:13 +00:00
|
|
|
}
|
2011-11-01 13:59:23 +00:00
|
|
|
}
|
|
|
|
} else:win32 {
|
2012-02-23 17:25:28 +00:00
|
|
|
CMAKE_WINDOWS_BUILD = "true"
|
2012-06-24 17:36:27 +00:00
|
|
|
CMAKE_FIND_OTHER_LIBRARY_BUILD = "true"
|
2012-02-23 16:05:41 +00:00
|
|
|
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.dll
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll
|
2012-02-23 17:25:28 +00:00
|
|
|
|
2014-01-08 13:12:17 +00:00
|
|
|
mingw {
|
2012-02-23 16:05:41 +00:00
|
|
|
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}d.a
|
|
|
|
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a
|
2012-02-23 17:25:28 +00:00
|
|
|
|
|
|
|
!isEmpty(CMAKE_STATIC_TYPE) {
|
2012-09-25 07:44:25 +00:00
|
|
|
CMAKE_STATIC_WINDOWS_BUILD = "true"
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
|
2012-09-25 08:35:59 +00:00
|
|
|
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
|
2012-02-23 17:25:28 +00:00
|
|
|
} else {
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
|
2012-02-23 17:25:28 +00:00
|
|
|
}
|
2012-02-23 16:05:41 +00:00
|
|
|
} else {
|
|
|
|
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}d.lib
|
|
|
|
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qtmain$${QT_LIBINFIX}.lib
|
2012-02-23 17:25:28 +00:00
|
|
|
|
|
|
|
!isEmpty(CMAKE_STATIC_TYPE) {
|
2012-09-25 07:44:25 +00:00
|
|
|
CMAKE_STATIC_WINDOWS_BUILD = "true"
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
|
2012-08-21 11:12:57 +00:00
|
|
|
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl
|
2012-02-23 17:25:28 +00:00
|
|
|
} else {
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
|
|
|
|
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
|
2012-02-23 17:25:28 +00:00
|
|
|
}
|
2012-02-23 16:05:41 +00:00
|
|
|
}
|
2011-11-01 13:59:23 +00:00
|
|
|
} else {
|
2012-02-02 21:40:30 +00:00
|
|
|
!isEmpty(CMAKE_STATIC_TYPE) {
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.a
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
|
|
|
|
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.prl
|
|
|
|
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
|
2014-05-26 01:18:48 +00:00
|
|
|
} else:unversioned_libname {
|
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.so
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.so
|
|
|
|
CMAKE_LIB_SONAME = lib$${CMAKE_QT_STEM}.so
|
2011-12-16 23:47:13 +00:00
|
|
|
} else {
|
2012-11-10 16:02:53 +00:00
|
|
|
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.so.$$eval(QT.$${MODULE}.VERSION)
|
|
|
|
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.so.$$eval(QT.$${MODULE}.VERSION)
|
2016-12-21 17:52:16 +00:00
|
|
|
CMAKE_LIB_SONAME = lib$${CMAKE_QT_STEM}.so.$$section(QT.$${MODULE}.VERSION, ., 0, 0)
|
2011-12-16 23:47:13 +00:00
|
|
|
}
|
2011-11-01 13:59:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
INSTALLS += cmake_qt5_module_files
|
|
|
|
|
2012-12-06 15:29:21 +00:00
|
|
|
cmake_config_file.input = $$PWD/data/cmake/Qt5BasicConfig.cmake.in
|
2015-04-15 11:59:39 +00:00
|
|
|
cmake_config_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Config.cmake
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-10-17 14:04:03 +00:00
|
|
|
CMAKE_PACKAGE_VERSION = $$eval(QT.$${MODULE}.VERSION)
|
|
|
|
|
2012-12-06 15:29:21 +00:00
|
|
|
cmake_config_version_file.input = $$PWD/data/cmake/Qt5ConfigVersion.cmake.in
|
2015-04-15 11:59:39 +00:00
|
|
|
cmake_config_version_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-08-27 17:56:04 +00:00
|
|
|
!build_pass:QMAKE_SUBSTITUTES += \
|
2011-11-01 13:59:23 +00:00
|
|
|
cmake_config_file \
|
|
|
|
cmake_config_version_file
|
|
|
|
|
|
|
|
cmake_qt5_module_files.files = \
|
|
|
|
$$cmake_config_file.output \
|
|
|
|
$$cmake_config_version_file.output
|
|
|
|
|
|
|
|
cmake_extras_file.input = $$_PRO_FILE_PWD_/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake.in
|
|
|
|
exists($$cmake_extras_file.input) {
|
|
|
|
|
|
|
|
CMAKE_MODULE_EXTRAS = "true"
|
2015-04-15 11:59:39 +00:00
|
|
|
cmake_extras_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-08-27 17:56:04 +00:00
|
|
|
!build_pass:QMAKE_SUBSTITUTES += cmake_extras_file
|
2011-11-01 13:59:23 +00:00
|
|
|
|
|
|
|
cmake_qt5_module_files.files += \
|
|
|
|
$$cmake_extras_file.output
|
|
|
|
}
|
|
|
|
|
2012-02-11 10:45:32 +00:00
|
|
|
cmake_macros_file.input = $$_PRO_FILE_PWD_/Qt5$${CMAKE_MODULE_NAME}Macros.cmake
|
|
|
|
exists($$cmake_macros_file.input) {
|
2011-11-01 13:59:23 +00:00
|
|
|
CMAKE_MODULE_MACROS = "true"
|
|
|
|
|
2015-04-15 11:59:39 +00:00
|
|
|
cmake_macros_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake
|
2012-07-03 20:29:45 +00:00
|
|
|
cmake_macros_file.CONFIG = verbatim
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-08-27 17:56:04 +00:00
|
|
|
!build_pass:QMAKE_SUBSTITUTES += cmake_macros_file
|
2011-11-01 13:59:23 +00:00
|
|
|
|
2012-02-11 10:45:32 +00:00
|
|
|
cmake_qt5_module_files.files += $$cmake_macros_file.output
|
2011-11-01 13:59:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
|
2014-06-17 08:41:38 +00:00
|
|
|
|
2014-06-25 10:46:41 +00:00
|
|
|
# We are generating cmake files. Most developers of Qt are not aware of cmake,
|
|
|
|
# so we require automatic tests to be available. The only module which should
|
|
|
|
# set CMAKE_MODULE_TESTS to '-' is enginio because that is known to be broken.
|
|
|
|
# Other modules should either create proper tests in tests/auto/cmake or, as
|
|
|
|
# a temporary measure, disable the generation of cmake files
|
|
|
|
# with 'CONFIG -= create_cmake'
|
2019-07-31 13:39:37 +00:00
|
|
|
!internal_module:!equals(CMAKE_MODULE_TESTS, -) {
|
2014-06-25 10:46:41 +00:00
|
|
|
isEmpty(CMAKE_MODULE_TESTS): CMAKE_MODULE_TESTS = $$MODULE_BASE_INDIR/tests/auto/cmake
|
2014-09-24 11:01:02 +00:00
|
|
|
!exists($$CMAKE_MODULE_TESTS): \
|
|
|
|
error("Missing CMake tests. Either create tests in tests/auto/cmake," \
|
|
|
|
"or disable cmake config file creation with CONFIG-=create_cmake.")
|
2014-06-25 10:46:41 +00:00
|
|
|
}
|