summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/create_cmake.prf
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-08-15 13:09:55 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-08-15 16:53:19 +0200
commitc7ec7cd2a1ae9bec31113fae1f1e549b2bf98e0b (patch)
treefc81fba4e7815ea061da277cf3bcf3102866932f /mkspecs/features/create_cmake.prf
parent7947032e2d1d68b2c0f79874db7adcf560851f29 (diff)
parent6132260da394a9627947f0fe6a279c20863b6ad2 (diff)
Merge branch 'wip/qt6' into wip/cmake
Diffstat (limited to 'mkspecs/features/create_cmake.prf')
-rw-r--r--mkspecs/features/create_cmake.prf28
1 files changed, 27 insertions, 1 deletions
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index 00da9bd33f..376a7ded5d 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -26,6 +26,10 @@ contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND
CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake
+internal_module {
+ MODULE = "$${MODULE}_private"
+}
+
# Core, Network, an external module named Foo
CMAKE_MODULE_NAME = $$cmakeModuleName($${MODULE})
@@ -112,6 +116,10 @@ win32:!static:!staticlib {
static|staticlib:CMAKE_STATIC_TYPE = true
+internal_module {
+ CMAKE_INTERNAL_MODULE = true
+}
+
CMAKE_DEBUG_TYPE =
CMAKE_RELEASE_TYPE =
@@ -133,6 +141,24 @@ equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
if(build_all|CONFIG(debug, debug|release)): CMAKE_DEBUG_TYPE = debug
if(build_all|CONFIG(release, debug|release)): CMAKE_RELEASE_TYPE = release
+# 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.
+debug_and_release {
+ CMAKE_DEBUG_AND_RELEASE = TRUE
+} else {
+ CMAKE_DEBUG_AND_RELEASE = FALSE
+}
+
contains(CONFIG, plugin) {
!isEmpty(PLUGIN_EXTENDS):!equals(PLUGIN_EXTENDS, -) {
count(PLUGIN_EXTENDS, 1, greaterThan): \
@@ -341,7 +367,7 @@ cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
# 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'
-!equals(CMAKE_MODULE_TESTS, -) {
+!internal_module:!equals(CMAKE_MODULE_TESTS, -) {
isEmpty(CMAKE_MODULE_TESTS): CMAKE_MODULE_TESTS = $$MODULE_BASE_INDIR/tests/auto/cmake
!exists($$CMAKE_MODULE_TESTS): \
error("Missing CMake tests. Either create tests in tests/auto/cmake," \