From 34a112e383d4ce3f6fe7417c1873fd3b33176032 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 29 Jan 2020 12:51:47 +0100 Subject: [PATCH] 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 --- cmake/QtBaseGlobalTargets.cmake | 8 +------- cmake/QtPostProcess.cmake | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 5dee41d0f4e..92745125776 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 807b32063dc..b16a4669883 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