Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmSetTargetPropertiesCommand.h
blobcc506181ca520ab928da8be09e0db4b52c2897c0
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmSetTargetPropertiesCommand.h,v $
5 Language: C++
6 <<<<<<< cmSetTargetPropertiesCommand.h
7 Date: $Date: 2008/01/23 15:27:59 $
8 Version: $Revision: 1.31 $
9 =======
10 Date: $Date: 2008-10-07 20:23:20 $
11 Version: $Revision: 1.32 $
12 >>>>>>> 1.32
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 #ifndef cmSetTargetsPropertiesCommand_h
23 #define cmSetTargetsPropertiesCommand_h
25 #include "cmCommand.h"
27 class cmSetTargetPropertiesCommand : public cmCommand
29 public:
30 virtual cmCommand* Clone()
32 return new cmSetTargetPropertiesCommand;
35 /**
36 * This is called when the command is first encountered in
37 * the input file.
39 virtual bool InitialPass(std::vector<std::string> const& args,
40 cmExecutionStatus &status);
42 /**
43 * The name of the command as specified in CMakeList.txt.
45 virtual const char* GetName() { return "set_target_properties";}
47 /**
48 * Succinct documentation.
50 virtual const char* GetTerseDocumentation()
52 return "Targets can have properties that affect how they are built.";
55 /**
56 * Used by this command and cmSetPropertiesCommand
58 static bool SetOneTarget(const char *tname,
59 std::vector<std::string> &propertyPairs,
60 cmMakefile *mf);
62 /**
63 * Longer documentation.
65 virtual const char* GetFullDocumentation()
67 return
68 " set_target_properties(target1 target2 ...\n"
69 " PROPERTIES prop1 value1\n"
70 " prop2 value2 ...)\n"
71 "Set properties on a target. The syntax for the command is to "
72 "list all the files you want "
73 "to change, and then provide the values you want to set next. "
74 "You can use any prop value pair you want and "
75 "extract it later with the GET_TARGET_PROPERTY command.\n"
76 "Properties that affect the name of a target's output file are "
77 "as follows. "
78 "The PREFIX and SUFFIX properties override the default target name "
79 "prefix (such as \"lib\") and suffix (such as \".so\"). "
80 "IMPORT_PREFIX and IMPORT_SUFFIX are the equivalent properties for "
81 "the import library corresponding to a DLL "
82 "(for SHARED library targets). "
83 "OUTPUT_NAME sets the real name of a target when it is built and "
84 "can be used to help create two targets of the same name even though "
85 "CMake requires unique logical target names. There is also a "
86 "<CONFIG>_OUTPUT_NAME that can set the output name on a "
87 "per-configuration basis. "
88 "<CONFIG>_POSTFIX sets a postfix for the real name of the target "
89 "when it is built under the configuration named by <CONFIG> "
90 "(in upper-case, such as \"DEBUG_POSTFIX\"). The value of "
91 "this property is initialized when the target is created to the "
92 "value of the variable CMAKE_<CONFIG>_POSTFIX (except for executable "
93 "targets because earlier CMake versions which did not use this "
94 "variable for executables)."
95 "\n"
96 "The LINK_FLAGS property can be used to add extra flags to the "
97 "link step of a target. LINK_FLAGS_<CONFIG> will add to the "
98 "configuration <CONFIG>, "
99 "for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO. "
100 "DEFINE_SYMBOL sets the name of the preprocessor symbol defined when "
101 "compiling sources in a shared library. "
102 "If not set here then it is set to target_EXPORTS by default "
103 "(with some substitutions if the target is not a valid C "
104 "identifier). This is useful for headers to know whether they are "
105 "being included from inside their library our outside to properly "
106 "setup dllexport/dllimport decorations. "
107 "The COMPILE_FLAGS property sets additional compiler flags used "
108 "to build sources within the target. It may also be used to pass "
109 "additional preprocessor definitions."
110 "\n"
111 "The LINKER_LANGUAGE property is used to change the tool "
112 "used to link an executable or shared library. The default is "
113 "set the language to match the files in the library. CXX and C "
114 "are common values for this property."
115 "\n"
116 "For shared libraries VERSION and SOVERSION can be used to specify "
117 "the build version and api version respectively. When building or "
118 "installing appropriate symlinks are created if the platform "
119 "supports symlinks and the linker supports so-names. "
120 "If only one of both is specified the missing is assumed to have "
121 "the same version number. "
122 "For executables VERSION can be used to specify the build version. "
123 "When building or installing appropriate symlinks are created if "
124 "the platform supports symlinks. "
125 "For shared libraries and executables on Windows the VERSION "
126 "attribute is parsed to extract a \"major.minor\" version number. "
127 "These numbers are used as the image version of the binary. "
128 "\n"
129 "There are a few properties used to specify RPATH rules. "
130 "INSTALL_RPATH is a semicolon-separated list specifying the rpath "
131 "to use in installed targets (for platforms that support it). "
132 "INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true will "
133 "append directories in the linker search path and outside the "
134 "project to the INSTALL_RPATH. "
135 "SKIP_BUILD_RPATH is a boolean specifying whether to skip automatic "
136 "generation of an rpath allowing the target to run from the "
137 "build tree. "
138 "BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link "
139 "the target in the build tree with the INSTALL_RPATH. This takes "
140 "precedence over SKIP_BUILD_RPATH and avoids the need for relinking "
141 "before installation. INSTALL_NAME_DIR is a string specifying the "
142 "directory portion of the \"install_name\" field of shared libraries "
143 "on Mac OSX to use in the installed targets. "
144 "When the target is created the values of "
145 "the variables CMAKE_INSTALL_RPATH, "
146 "CMAKE_INSTALL_RPATH_USE_LINK_PATH, CMAKE_SKIP_BUILD_RPATH, "
147 "CMAKE_BUILD_WITH_INSTALL_RPATH, and CMAKE_INSTALL_NAME_DIR "
148 "are used to initialize these properties.\n"
149 "PROJECT_LABEL can be used to change the name of "
150 "the target in an IDE like visual studio. VS_KEYWORD can be set "
151 "to change the visual studio keyword, for example QT integration "
152 "works better if this is set to Qt4VSv1.0.\n"
153 "VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER can be set "
154 "to add support for source control bindings in a Visual Studio "
155 "project file.\n"
156 "When a library is built CMake by default generates code to remove "
157 "any existing library using all possible names. This is needed "
158 "to support libraries that switch between STATIC and SHARED by "
159 "a user option. However when using OUTPUT_NAME to build a static "
160 "and shared library of the same name using different logical target "
161 "names the two targets will remove each other's files. This can be "
162 "prevented by setting the CLEAN_DIRECT_OUTPUT property to 1.\n"
163 "The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the "
164 "old way to specify CMake scripts to run before and after "
165 "installing a target. They are used only when the old "
166 "INSTALL_TARGETS command is used to install the target. Use the "
167 "INSTALL command instead."
168 "\n"
169 "The EXCLUDE_FROM_DEFAULT_BUILD property is used by the visual "
170 "studio generators. If it is set to 1 the target will not be "
171 "part of the default build when you select \"Build Solution\"."
175 cmTypeMacro(cmSetTargetPropertiesCommand, cmCommand);
180 #endif