summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-02-26 13:23:05 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-03-05 07:48:06 +0100
commit46a2366d12839e009e6010c584ce73e6af04fdbe (patch)
tree710aac89d91d57a84aad4537d949789d3665968b
parent20410cdc116c5015e5fe2ee3885d6466fba8827f (diff)
CMake: Port the 'debug_and_release' feature
This feature is read-only. It's controlled by the multi-config feature of CMake. It mainly exists for the qmake support. Change-Id: I322459598fe92568eda4d42319ded444537e95d4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--cmake/QtSetup.cmake3
-rw-r--r--configure.cmake6
-rwxr-xr-xutil/cmake/configurejson2cmake.py5
3 files changed, 13 insertions, 1 deletions
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake
index 90588c99b3..629c49e2e4 100644
--- a/cmake/QtSetup.cmake
+++ b/cmake/QtSetup.cmake
@@ -13,6 +13,9 @@ endif()
# Reset content of extra build internal vars for each inclusion of QtSetup.
unset(QT_EXTRA_BUILD_INTERNALS_VARS)
+# Save the global property in a variable to make it available to feature conditions.
+get_property(QT_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${_default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${_default_build_type}" CACHE STRING "Choose the type of build." FORCE)
diff --git a/configure.cmake b/configure.cmake
index 5426b8c107..c204a836e2 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -356,6 +356,12 @@ qt_feature("debug"
AUTODETECT QT_FEATURE_developer_build OR ( WIN32 AND NOT GCC ) OR APPLE
CONDITION Debug STREQUAL CMAKE_BUILD_TYPE OR Debug IN_LIST CMAKE_CONFIGURATION_TYPES
)
+qt_feature("debug_and_release" PUBLIC
+ LABEL "Compile libs in debug and release mode"
+ AUTODETECT 1
+ CONDITION QT_GENERATOR_IS_MULTI_CONFIG
+)
+qt_feature_config("debug_and_release" QMAKE_PUBLIC_QT_CONFIG)
qt_feature("appstore-compliant" PUBLIC
LABEL "App store compliance"
PURPOSE "Disables code that is not allowed in platform app stores"
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py
index 135d26b9bf..2c65703d59 100755
--- a/util/cmake/configurejson2cmake.py
+++ b/util/cmake/configurejson2cmake.py
@@ -700,7 +700,10 @@ def parseFeature(ctx, feature, data, cm_fh):
"ccache": None,
"compiler-flags": None,
"cross_compile": None,
- "debug_and_release": None,
+ "debug_and_release": {
+ "autoDetect": "1", # Setting this to None has weird effects...
+ "condition": "QT_GENERATOR_IS_MULTI_CONFIG"
+ },
"debug": {"condition": "Debug STREQUAL CMAKE_BUILD_TYPE OR Debug IN_LIST CMAKE_CONFIGURATION_TYPES"},
"dlopen": {"condition": "UNIX"},
"doubleconversion": None,