CMakePM: Always set the comiplers from the CMake Preset probe

In cases when a CMake project is using a CMake preset with a toolchain
file, the CMAKE_C|XX_COMIPLER value was not set in the CMakeCache.txt.

This commit makes sure that the cache from the CMake preset probe
contains CMAKE_C|XX_COMPILER values.

Task-number: QTCREATORBUG-30474
Change-Id: I63ac6fe2b043e49dda98e286b6d85950e34be920
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2024-03-18 12:37:52 +01:00
parent 85b3413daf
commit 2c598814bb

View File

@@ -245,6 +245,8 @@ static CMakeConfig configurationFromPresetProbe(
cmakeListTxt.writeFileContents(QByteArray("cmake_minimum_required(VERSION 3.15)\n"
"\n"
"project(preset-probe)\n"
"set(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\" CACHE FILEPATH \"\" FORCE)\n"
"set(CMAKE_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\" CACHE FILEPATH \"\" FORCE)\n"
"\n"));
Process cmake;