diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-01-13 20:59:48 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2022-01-20 14:05:35 (GMT) |
commit | fce24e4f102686c5c103db301bb698e0ea82765f (patch) | |
tree | e5effdc88ea773c899b08b084aaf89dc936885dc /Source/cmPropertyDefinition.h | |
parent | 1ca83ae2bbf9e474c46b6ea094c5035420bbfd45 (diff) | |
download | CMake-fce24e4f102686c5c103db301bb698e0ea82765f.zip CMake-fce24e4f102686c5c103db301bb698e0ea82765f.tar.gz CMake-fce24e4f102686c5c103db301bb698e0ea82765f.tar.bz2 |
define_property(): Add INITIALIZE_FROM_VARIABLE argument
Fixes: #20698
Diffstat (limited to 'Source/cmPropertyDefinition.h')
-rw-r--r-- | Source/cmPropertyDefinition.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/cmPropertyDefinition.h b/Source/cmPropertyDefinition.h index fca936e..9dd2cfe 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_; }; |