From 2ed9aeb68755c92b810e20a37f484d32987d30a3 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 30 Jan 2020 14:21:34 +0100 Subject: [PATCH] Fix CMAKE_BUILD_TYPE to be force set Otherwise CMake sets an up an empty default value itself, and then the value in QtBuildInternalsExtra does not end up being used, and then QtSetup ends up setting a Debug value. Amends 34a112e383d4ce3f6fe7417c1873fd3b33176032 Change-Id: If97a1d8c19ad5e7f690283997ff80dd9588cd521 Reviewed-by: Simon Hausmann --- cmake/QtPostProcess.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index b16a466988..ab2cab447f 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -308,8 +308,12 @@ function(qt_generate_build_internals_extra_cmake_code) ${INSTALL_CMAKE_NAMESPACE}BuildInternals/QtBuildInternalsExtra.cmake) if(CMAKE_BUILD_TYPE) + # Need to force set, because CMake itself initializes a value for CMAKE_BUILD_TYPE + # at the start of project configuration (with an empty value), + # so we need to force override it. string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS - "set(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\" CACHE STRING \"Choose the type of build.\")\n") + "set(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\" CACHE STRING \"Choose the type of build.\" FORCE)\n") + endif() if(CMAKE_CONFIGURATION_TYPES) string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS