summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-01-29 09:55:04 +0100
committerLeander Beernaert <leander.beernaert@qt.io>2020-01-29 09:39:32 +0000
commitf72ca4cf853619efb99ab08da803536392229d37 (patch)
treebed06de14d238281feafaa2df6a25be45a153aec /cmake
parent88b7f64e7385e51831b3a852c88d6bbcdc665d87 (diff)
Forward CMAKE_BUILD_TYPE, if available, in qt-cmake
Change-Id: I299e16cfc084b3fc009e806902e26121ebdd454b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBaseGlobalTargets.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake
index 9274512577..5dee41d0f4 100644
--- a/cmake/QtBaseGlobalTargets.cmake
+++ b/cmake/QtBaseGlobalTargets.cmake
@@ -129,6 +129,11 @@ 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}")
@@ -145,7 +150,8 @@ 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.
-set(__qt_cmake_extra "-G\"${CMAKE_GENERATOR}\"")
+
+list(APPEND __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)