summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-01-29 12:51:47 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-01-29 11:56:27 +0000
commit34a112e383d4ce3f6fe7417c1873fd3b33176032 (patch)
treee5534e22213290f53113d8ab1ea7092eafb5b1c2 /cmake
parent3ad5d7aa55fe38e3ee57a56b53ab662f0059d8fd (diff)
Fix CMAKE_BUILD_TYPE to be a cache variable in QtBuildInternalsExtra
Rather than pass the build type in the wrapper, make sure the build type is a cache var, so it gets picked up when building other repos. This reverts commit f72ca4cf853619efb99ab08da803536392229d37. Change-Id: I5d91ab66249b6c40c5e548b0eec0e467ba0f2ebc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBaseGlobalTargets.cmake8
-rw-r--r--cmake/QtPostProcess.cmake2
2 files changed, 2 insertions, 8 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake
index 5dee41d0f4..9274512577 100644
--- a/cmake/QtBaseGlobalTargets.cmake
+++ b/cmake/QtBaseGlobalTargets.cmake
@@ -129,11 +129,6 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/qt.toolchain.cmake.in" "${__Gl
qt_install(FILES "${__GlobalConfig_build_dir}/qt.toolchain.cmake" DESTINATION "${__GlobalConfig_install_dir}" COMPONENT Devel)
# Also provide a convenience cmake wrapper
-if (CMAKE_BUILD_TYPE)
- set(__qt_cmake_extra "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
-else()
- set(__qt_cmake_extra)
-endif()
if(UNIX)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.in" "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake" @ONLY)
qt_install(PROGRAMS "${QT_BUILD_DIR}/bin/qt-cmake" DESTINATION "${INSTALL_BINDIR}")
@@ -150,8 +145,7 @@ endif()
# generator.
# The private wrapper is more conveient for building Qt itself, because a developer doesn't need
# to specify the same options for each qt module built.
-
-list(APPEND __qt_cmake_extra "-G\"${CMAKE_GENERATOR}\"")
+set(__qt_cmake_extra "-G\"${CMAKE_GENERATOR}\"")
if(UNIX)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.in"
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake-private" @ONLY)
diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake
index 807b32063d..b16a466988 100644
--- a/cmake/QtPostProcess.cmake
+++ b/cmake/QtPostProcess.cmake
@@ -309,7 +309,7 @@ function(qt_generate_build_internals_extra_cmake_code)
if(CMAKE_BUILD_TYPE)
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS
- "set(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n")
+ "set(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\" CACHE STRING \"Choose the type of build.\")\n")
endif()
if(CMAKE_CONFIGURATION_TYPES)
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS