1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmDefinePropertyCommand.h,v $
6 Date: $Date: 2009-09-03 19:29:29 $
7 Version: $Revision: 1.8 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmDefinesPropertyCommand_h
18 #define cmDefinesPropertyCommand_h
20 #include "cmCommand.h"
22 class cmDefinePropertyCommand
: public cmCommand
25 virtual cmCommand
* Clone()
27 return new cmDefinePropertyCommand
;
31 * This is called when the command is first encountered in
34 virtual bool InitialPass(std::vector
<std::string
> const& args
,
35 cmExecutionStatus
&status
);
38 * The name of the command as specified in CMakeList.txt.
40 virtual const char* GetName() { return "define_property";}
43 * Succinct documentation.
45 virtual const char* GetTerseDocumentation()
47 return "Define and document custom properties.";
51 * Longer documentation.
53 virtual const char* GetFullDocumentation()
56 " define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |\n"
57 " TEST | VARIABLE | CACHED_VARIABLE>\n"
58 " PROPERTY <name> [INHERITED]\n"
59 " BRIEF_DOCS <brief-doc> [docs...]\n"
60 " FULL_DOCS <full-doc> [docs...])\n"
61 "Define one property in a scope for use with the "
62 "set_property and get_property commands. "
63 "This is primarily useful to associate documentation with property "
64 "names that may be retrieved with the get_property command. "
65 "The first argument determines the kind of scope in which the "
66 "property should be used. It must be one of the following:\n"
67 " GLOBAL = associated with the global namespace\n"
68 " DIRECTORY = associated with one directory\n"
69 " TARGET = associated with one target\n"
70 " SOURCE = associated with one source file\n"
71 " TEST = associated with a test named with add_test\n"
72 " VARIABLE = documents a CMake language variable\n"
73 " CACHED_VARIABLE = documents a CMake cache variable\n"
74 "Note that unlike set_property and get_property no actual scope "
75 "needs to be given; only the kind of scope is important.\n"
76 "The required PROPERTY option is immediately followed by the name "
77 "of the property being defined.\n"
78 "If the INHERITED option then the get_property command will chain "
79 "up to the next higher scope when the requested property is not "
80 "set in the scope given to the command. "
81 "DIRECTORY scope chains to GLOBAL. "
82 "TARGET, SOURCE, and TEST chain to DIRECTORY.\n"
83 "The BRIEF_DOCS and FULL_DOCS options are followed by strings to be "
84 "associated with the property as its brief and full documentation. "
85 "Corresponding options to the get_property command will retrieve the "
89 cmTypeMacro(cmDefinePropertyCommand
, cmCommand
);
91 std::string PropertyName
;
92 std::string BriefDocs
;