summaryrefslogtreecommitdiffstats
path: root/Source/cmCMakePresetsFile.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCMakePresetsFile.h')
-rw-r--r--Source/cmCMakePresetsFile.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/Source/cmCMakePresetsFile.h b/Source/cmCMakePresetsFile.h
index 3067d5e..fc14830 100644
--- a/Source/cmCMakePresetsFile.h
+++ b/Source/cmCMakePresetsFile.h
@@ -2,8 +2,11 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
+#include "cmConfigure.h" // IWYU pragma: keep
+
#include <functional>
#include <map>
+#include <memory>
#include <string>
#include <utility>
#include <vector>
@@ -33,6 +36,9 @@ public:
INVALID_MACRO_EXPANSION,
BUILD_TEST_PRESETS_UNSUPPORTED,
INVALID_CONFIGURE_PRESET,
+ INSTALL_PREFIX_UNSUPPORTED,
+ INVALID_CONDITION,
+ CONDITION_UNSUPPORTED,
};
enum class ArchToolsetStrategy
@@ -48,6 +54,8 @@ public:
std::string Value;
};
+ class Condition;
+
class Preset
{
public:
@@ -70,6 +78,9 @@ public:
std::string DisplayName;
std::string Description;
+ std::shared_ptr<Condition> ConditionEvaluator;
+ bool ConditionResult = true;
+
std::map<std::string, cm::optional<std::string>> Environment;
virtual ReadFileResult VisitPresetInherit(const Preset& parent) = 0;
@@ -78,7 +89,7 @@ public:
return ReadFileResult::READ_OK;
}
- virtual ReadFileResult VisitPresetAfterInherit()
+ virtual ReadFileResult VisitPresetAfterInherit(int /* version */)
{
return ReadFileResult::READ_OK;
}
@@ -103,6 +114,7 @@ public:
std::string Toolset;
cm::optional<ArchToolsetStrategy> ToolsetStrategy;
std::string BinaryDir;
+ std::string InstallDir;
std::map<std::string, cm::optional<CacheVariable>> CacheVariables;
@@ -120,7 +132,7 @@ public:
ReadFileResult VisitPresetInherit(const Preset& parent) override;
ReadFileResult VisitPresetBeforeInherit() override;
- ReadFileResult VisitPresetAfterInherit() override;
+ ReadFileResult VisitPresetAfterInherit(int version) override;
};
class BuildPreset : public Preset
@@ -146,7 +158,7 @@ public:
std::vector<std::string> NativeToolOptions;
ReadFileResult VisitPresetInherit(const Preset& parent) override;
- ReadFileResult VisitPresetAfterInherit() override;
+ ReadFileResult VisitPresetAfterInherit(int /* version */) override;
};
class TestPreset : public Preset
@@ -273,7 +285,7 @@ public:
cm::optional<ExecutionOptions> Execution;
ReadFileResult VisitPresetInherit(const Preset& parent) override;
- ReadFileResult VisitPresetAfterInherit() override;
+ ReadFileResult VisitPresetAfterInherit(int /* version */) override;
};
template <class T>
@@ -293,6 +305,13 @@ public:
std::vector<std::string> TestPresetOrder;
std::string SourceDir;
+ int Version;
+ int UserVersion;
+
+ int GetVersion(const Preset& preset) const
+ {
+ return preset.User ? this->UserVersion : this->Version;
+ }
static std::string GetFilename(const std::string& sourceDir);
static std::string GetUserFilename(const std::string& sourceDir);