1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #include "cmPropertyDefinition.h"
7 cmPropertyDefinition::cmPropertyDefinition(std::string shortDescription,
8 std::string fullDescription,
10 std::string initializeFromVariable)
11 : ShortDescription(std::move(shortDescription))
12 , FullDescription(std::move(fullDescription))
14 , InitializeFromVariable(std::move(initializeFromVariable))
18 void cmPropertyDefinitionMap::DefineProperty(
19 const std::string& name, cmProperty::ScopeType scope,
20 const std::string& ShortDescription, const std::string& FullDescription,
21 bool chain, const std::string& initializeFromVariable)
23 auto it = this->Map_.find(KeyType(name, scope));
24 if (it == this->Map_.end()) {
25 // try_emplace() since C++17
26 this->Map_.emplace(std::piecewise_construct,
27 std::forward_as_tuple(name, scope),
28 std::forward_as_tuple(ShortDescription, FullDescription,
29 chain, initializeFromVariable));
33 cmPropertyDefinition const* cmPropertyDefinitionMap::GetPropertyDefinition(
34 const std::string& name, cmProperty::ScopeType scope) const
36 auto it = this->Map_.find(KeyType(name, scope));
37 if (it != this->Map_.end()) {