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 f72ca4cf85.

Change-Id: I5d91ab66249b6c40c5e548b0eec0e467ba0f2ebc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Alexandru Croitor 2020-01-29 12:51:47 +01:00
parent 3ad5d7aa55
commit 34a112e383
2 changed files with 2 additions and 8 deletions

View File

@ -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)

View File

@ -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