summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/create_cmake.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/create_cmake.prf')
-rw-r--r--mkspecs/features/create_cmake.prf18
1 files changed, 18 insertions, 0 deletions
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index 00da9bd33f..68e6b6d265 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -133,6 +133,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): \