1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmPropertyDefinitionMap.cxx,v $
6 <<<<<<< cmPropertyDefinitionMap.cxx
7 Date: $Date: 2007/10/23 14:40:49 $
8 Version: $Revision: 1.5 $
10 Date: $Date: 2009-03-10 15:10:42 $
11 Version: $Revision: 1.6 $
14 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
15 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
17 This software is distributed WITHOUT ANY WARRANTY; without even
18 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19 PURPOSE. See the above copyright notices for more information.
21 =========================================================================*/
22 #include "cmPropertyDefinitionMap.h"
23 #include "cmSystemTools.h"
24 #include "cmDocumentationSection.h"
26 void cmPropertyDefinitionMap
27 ::DefineProperty(const char *name
, cmProperty::ScopeType scope
,
28 const char *ShortDescription
,
29 const char *FullDescription
,
30 const char *DocumentationSection
,
38 cmPropertyDefinitionMap::iterator it
= this->find(name
);
39 cmPropertyDefinition
*prop
;
40 if (it
== this->end())
42 prop
= &(*this)[name
];
43 prop
->DefineProperty(name
,scope
,ShortDescription
, FullDescription
,
44 DocumentationSection
, chain
);
48 void cmPropertyDefinitionMap
49 ::GetPropertiesDocumentation(std::map
<std::string
,
50 cmDocumentationSection
*>& v
) const
52 for(cmPropertyDefinitionMap::const_iterator j
= this->begin();
53 j
!= this->end(); ++j
)
55 // add a section if needed
56 std::string secName
= j
->second
.GetDocumentationSection();
57 // if a section was not specified then use the scope
60 switch (j
->second
.GetScope())
62 case cmProperty::GLOBAL
:
63 secName
= "Properties of Global Scope";
65 case cmProperty::TARGET
:
66 secName
= "Properties on Targets";
68 case cmProperty::SOURCE_FILE
:
69 secName
= "Properties on Source Files";
71 case cmProperty::DIRECTORY
:
72 secName
= "Properties on Directories";
74 case cmProperty::TEST
:
75 secName
= "Properties on Tests";
77 case cmProperty::CACHE
:
78 secName
= "Properties on Cache Entries";
80 case cmProperty::VARIABLE
:
81 secName
= "Variables";
83 case cmProperty::CACHED_VARIABLE
:
84 secName
= "Cached Variables";
87 secName
= "Properties of Unknown Scope";
94 cmDocumentationSection(secName
.c_str(),
95 cmSystemTools::UpperCase(secName
).c_str());
97 cmDocumentationEntry e
= j
->second
.GetDocumentation();
98 if (e
.Brief
.size() || e
.Full
.size())
100 v
[secName
]->Append(e
);
105 bool cmPropertyDefinitionMap::IsPropertyDefined(const char *name
)
112 cmPropertyDefinitionMap::iterator it
= this->find(name
);
113 if (it
== this->end())
121 bool cmPropertyDefinitionMap::IsPropertyChained(const char *name
)
128 cmPropertyDefinitionMap::iterator it
= this->find(name
);
129 if (it
== this->end())
134 return it
->second
.IsChained();