Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmSetPropertyCommand.h
blob3d226d594769d836c703802ff8d51343af4f7f12
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmSetPropertyCommand.h,v $
5 Language: C++
6 Date: $Date: 2008/01/23 15:27:59 $
7 Version: $Revision: 1.3 $
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 cmSetsPropertiesCommand_h
18 #define cmSetsPropertiesCommand_h
20 #include "cmCommand.h"
22 class cmSetPropertyCommand : public cmCommand
24 public:
25 cmSetPropertyCommand();
27 virtual cmCommand* Clone()
29 return new cmSetPropertyCommand;
32 /**
33 * This is called when the command is first encountered in
34 * the input file.
36 virtual bool InitialPass(std::vector<std::string> const& args,
37 cmExecutionStatus &status);
39 /**
40 * The name of the command as specified in CMakeList.txt.
42 virtual const char* GetName() { return "set_property";}
44 /**
45 * Succinct documentation.
47 virtual const char* GetTerseDocumentation()
49 return "Set a named property in a given scope.";
52 /**
53 * Longer documentation.
55 virtual const char* GetFullDocumentation()
57 return
58 " set_property(<GLOBAL |\n"
59 " DIRECTORY [dir] |\n"
60 " TARGET [target1 [target2 ...]] |\n"
61 " SOURCE [src1 [src2 ...]] |\n"
62 " TEST [test1 [test2 ...]]>\n"
63 " [APPEND]\n"
64 " PROPERTY <name> [value1 [value2 ...]])\n"
65 "Set one property on zero or more objects of a scope. "
66 "The first argument determines the scope in which the property "
67 "is set. It must be one of the following:\n"
68 "GLOBAL scope is unique and does not accept a name.\n"
69 "DIRECTORY scope defaults to the current directory but another "
70 "directory (already processed by CMake) may be named by full or "
71 "relative path.\n"
72 "TARGET scope may name zero or more existing targets.\n"
73 "SOURCE scope may name zero or more source files.\n"
74 "TEST scope may name zero or more existing tests.\n"
75 "The required PROPERTY option is immediately followed by the name "
76 "of the property to set. Remaining arguments are used to "
77 "compose the property value in the form of a semicolon-separated "
78 "list. "
79 "If the APPEND option is given the list is appended to any "
80 "existing property value."
84 /**
85 * This determines if the command is invoked when in script mode.
87 virtual bool IsScriptable() { return true; }
89 cmTypeMacro(cmSetPropertyCommand, cmCommand);
91 private:
92 std::set<cmStdString> Names;
93 std::string PropertyName;
94 std::string PropertyValue;
95 bool AppendMode;
97 // Implementation of each property type.
98 bool HandleGlobalMode();
99 bool HandleDirectoryMode();
100 bool HandleTargetMode();
101 bool HandleTarget(cmTarget* target);
102 bool HandleSourceMode();
103 bool HandleSource(cmSourceFile* sf);
104 bool HandleTestMode();
105 bool HandleTest(cmTest* test);
110 #endif