1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #ifndef cmDefinesPropertyCommand_h
13 #define cmDefinesPropertyCommand_h
15 #include "cmCommand.h"
17 class cmDefinePropertyCommand : public cmCommand
20 virtual cmCommand* Clone()
22 return new cmDefinePropertyCommand;
26 * This is called when the command is first encountered in
29 virtual bool InitialPass(std::vector<std::string> const& args,
30 cmExecutionStatus &status);
33 * The name of the command as specified in CMakeList.txt.
35 virtual const char* GetName() const { return "define_property";}
38 * Succinct documentation.
40 virtual const char* GetTerseDocumentation() const
42 return "Define and document custom properties.";
46 * Longer documentation.
48 virtual const char* GetFullDocumentation() const
51 " define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |\n"
52 " TEST | VARIABLE | CACHED_VARIABLE>\n"
53 " PROPERTY <name> [INHERITED]\n"
54 " BRIEF_DOCS <brief-doc> [docs...]\n"
55 " FULL_DOCS <full-doc> [docs...])\n"
56 "Define one property in a scope for use with the "
57 "set_property and get_property commands. "
58 "This is primarily useful to associate documentation with property "
59 "names that may be retrieved with the get_property command. "
60 "The first argument determines the kind of scope in which the "
61 "property should be used. It must be one of the following:\n"
62 " GLOBAL = associated with the global namespace\n"
63 " DIRECTORY = associated with one directory\n"
64 " TARGET = associated with one target\n"
65 " SOURCE = associated with one source file\n"
66 " TEST = associated with a test named with add_test\n"
67 " VARIABLE = documents a CMake language variable\n"
68 " CACHED_VARIABLE = documents a CMake cache variable\n"
69 "Note that unlike set_property and get_property no actual scope "
70 "needs to be given; only the kind of scope is important.\n"
71 "The required PROPERTY option is immediately followed by the name "
72 "of the property being defined.\n"
73 "If the INHERITED option then the get_property command will chain "
74 "up to the next higher scope when the requested property is not "
75 "set in the scope given to the command. "
76 "DIRECTORY scope chains to GLOBAL. "
77 "TARGET, SOURCE, and TEST chain to DIRECTORY.\n"
78 "The BRIEF_DOCS and FULL_DOCS options are followed by strings to be "
79 "associated with the property as its brief and full documentation. "
80 "Corresponding options to the get_property command will retrieve the "
84 cmTypeMacro(cmDefinePropertyCommand, cmCommand);
86 std::string PropertyName;
87 std::string BriefDocs;