1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmConfigure.h" // IWYU pragma: keep
11 #include "cmProperty.h"
13 /** \class cmPropertyDefinition
14 * \brief Property meta-information
16 * This class contains the following meta-information about property:
17 * - Various documentation strings;
18 * - If the property is chained.
20 class cmPropertyDefinition
24 cmPropertyDefinition(std::string shortDescription,
25 std::string fullDescription, bool chained,
26 std::string initializeFromVariable);
28 /// Is the property chained?
29 bool IsChained() const { return this->Chained; }
31 /// Get the documentation (short version)
32 const std::string& GetShortDescription() const
34 return this->ShortDescription;
37 /// Get the documentation (full version)
38 const std::string& GetFullDescription() const
40 return this->FullDescription;
43 /// Get the variable the property is initialized from
44 const std::string& GetInitializeFromVariable() const
46 return this->InitializeFromVariable;
50 std::string ShortDescription;
51 std::string FullDescription;
53 std::string InitializeFromVariable;
56 /** \class cmPropertyDefinitionMap
57 * \brief Map property name and scope to their definition
59 class cmPropertyDefinitionMap
62 // define the property
63 void DefineProperty(const std::string& name, cmProperty::ScopeType scope,
64 const std::string& ShortDescription,
65 const std::string& FullDescription, bool chain,
66 const std::string& initializeFromVariable);
68 // get the property definition if present, otherwise nullptr
69 cmPropertyDefinition const* GetPropertyDefinition(
70 const std::string& name, cmProperty::ScopeType scope) const;
72 using KeyType = std::pair<std::string, cmProperty::ScopeType>;
73 const std::map<KeyType, cmPropertyDefinition>& GetMap() const
79 std::map<KeyType, cmPropertyDefinition> Map_;