From 16b147d563478ae1aa88423e47e9086ee98d280c Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 13 Oct 2023 19:03:43 +0200 Subject: [PATCH] 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 --- src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index bacde7ea39c..6455ad3ea26 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -658,6 +658,11 @@ QList CMakeProjectImporter::examineDirectory(const FilePath &importPath, const CMakeTool *cmakeTool = CMakeToolManager::defaultCMakeTool(); if (cmakeTool) 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());