CMakePM: Add supprot for CMakePresets version 3

This includes Condition and toolchainFile

https://cmake.org/cmake/help/v3.21/manual/cmake-presets.7.html

Task-number: QTCREATORBUG-24555
Change-Id: I1026390af67b2be1aa0c3b02b654fc19442d3c89
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2022-09-26 18:59:04 +02:00
parent 45a275e054
commit ee4c998ff3
7 changed files with 430 additions and 27 deletions

View File

@@ -12,6 +12,10 @@ class FilePath;
namespace CMakeProjectManager::Internal {
namespace PresetsDetails {
class ConfigurePreset;
}
namespace CMakePresets::Macros {
/**
* Expands the CMakePresets Macros using Utils::Environment as target and source for parent environment values.
@@ -40,6 +44,22 @@ void expand(const PresetType &preset,
const Utils::FilePath &sourceDirectory,
QString &value);
/**
* Updates the cacheVariables parameter of the configurePreset with the expandned toolchainFile parameter.
* Including macro expansion and relative paths resolving.
*/
void updateToolchainFile(PresetsDetails::ConfigurePreset &configurePreset,
const Utils::Environment &env,
const Utils::FilePath &sourceDirectory,
const Utils::FilePath &buildDirectory);
/**
* Expands the condition values and then evaluates the condition object of the preset and returns
* the boolean result.
*/
template<class PresetType>
bool evaluatePresetCondition(const PresetType &preset, const Utils::FilePath &sourceDirectory);
} // namespace CMakePresets::Macros
} // namespace CMakeProjectManager::Internal