summaryrefslogtreecommitdiff
path: root/Source/cmPropertyDefinition.h
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-01-13 15:59:48 -0500
committerKyle Edwards <kyle.edwards@kitware.com>2022-01-20 09:05:35 -0500
commitfce24e4f102686c5c103db301bb698e0ea82765f (patch)
treee5effdc88ea773c899b08b084aaf89dc936885dc /Source/cmPropertyDefinition.h
parent1ca83ae2bbf9e474c46b6ea094c5035420bbfd45 (diff)
downloadcmake-fce24e4f102686c5c103db301bb698e0ea82765f.tar.gz
define_property(): Add INITIALIZE_FROM_VARIABLE argument
Fixes: #20698
Diffstat (limited to 'Source/cmPropertyDefinition.h')
-rw-r--r--Source/cmPropertyDefinition.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/cmPropertyDefinition.h b/Source/cmPropertyDefinition.h
index fca936e29a..9dd2cfe26d 100644
--- a/Source/cmPropertyDefinition.h
+++ b/Source/cmPropertyDefinition.h
@@ -22,7 +22,8 @@ class cmPropertyDefinition
public:
/// Constructor
cmPropertyDefinition(std::string shortDescription,
- std::string fullDescription, bool chained);
+ std::string fullDescription, bool chained,
+ std::string initializeFromVariable);
/// Is the property chained?
bool IsChained() const { return this->Chained; }
@@ -39,10 +40,17 @@ public:
return this->FullDescription;
}
+ /// Get the variable the property is initialized from
+ const std::string& GetInitializeFromVariable() const
+ {
+ return this->InitializeFromVariable;
+ }
+
private:
std::string ShortDescription;
std::string FullDescription;
bool Chained;
+ std::string InitializeFromVariable;
};
/** \class cmPropertyDefinitionMap
@@ -54,13 +62,19 @@ public:
// define the property
void DefineProperty(const std::string& name, cmProperty::ScopeType scope,
const std::string& ShortDescription,
- const std::string& FullDescription, bool chain);
+ const std::string& FullDescription, bool chain,
+ const std::string& initializeFromVariable);
// get the property definition if present, otherwise nullptr
cmPropertyDefinition const* GetPropertyDefinition(
const std::string& name, cmProperty::ScopeType scope) const;
+ using KeyType = std::pair<std::string, cmProperty::ScopeType>;
+ const std::map<KeyType, cmPropertyDefinition>& GetMap() const
+ {
+ return this->Map_;
+ }
+
private:
- using key_type = std::pair<std::string, cmProperty::ScopeType>;
- std::map<key_type, cmPropertyDefinition> Map_;
+ std::map<KeyType, cmPropertyDefinition> Map_;
};