CMakePM: Expand macros in cmakeExecutable CMake preset value

The specification allows this, so we need to support it.

Task-number: QTCREATORBUG-29643
Change-Id: I8bd0a91ba05d2ed27b7a7af2d268539de020826f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2023-10-13 19:03:43 +02:00
parent 12a6d9e5dc
commit 16b147d563

View File

@@ -658,6 +658,11 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
const CMakeTool *cmakeTool = CMakeToolManager::defaultCMakeTool(); const CMakeTool *cmakeTool = CMakeToolManager::defaultCMakeTool();
if (cmakeTool) if (cmakeTool)
configurePreset.cmakeExecutable = cmakeTool->cmakeExecutable().toString(); configurePreset.cmakeExecutable = cmakeTool->cmakeExecutable().toString();
} else {
QString cmakeExecutable = configurePreset.cmakeExecutable.value();
CMakePresets::Macros::expand(configurePreset, env, projectDirectory(), cmakeExecutable);
configurePreset.cmakeExecutable = FilePath::fromUserInput(cmakeExecutable).path();
} }
data->cmakeBinary = Utils::FilePath::fromString(configurePreset.cmakeExecutable.value()); data->cmakeBinary = Utils::FilePath::fromString(configurePreset.cmakeExecutable.value());