1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2013 Stephen Kelly <steveire@gmail.com>
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 ============================================================================*/
13 #ifndef cmTargetCompileDefinitionsCommand_h
14 #define cmTargetCompileDefinitionsCommand_h
16 #include "cmTargetPropCommandBase.h"
18 class cmTargetCompileDefinitionsCommand : public cmTargetPropCommandBase
22 * This is a virtual constructor for the command.
24 virtual cmCommand* Clone()
26 return new cmTargetCompileDefinitionsCommand;
30 * This is called when the command is first encountered in
31 * the CMakeLists.txt file.
33 virtual bool InitialPass(std::vector<std::string> const& args,
34 cmExecutionStatus &status);
37 * The name of the command as specified in CMakeList.txt.
39 virtual const char* GetName() const { return "target_compile_definitions";}
42 * Succinct documentation.
44 virtual const char* GetTerseDocumentation() const
47 "Add compile definitions to a target.";
53 virtual const char* GetFullDocumentation() const
56 " target_compile_definitions(<target> "
57 "<INTERFACE|PUBLIC|PRIVATE> [items1...]\n"
58 " [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])\n"
59 "Specify compile definitions to use when compiling a given target. "
60 "The named <target> must have been created by a command such as "
61 "add_executable or add_library and must not be an IMPORTED target. "
62 "The INTERFACE, PUBLIC and PRIVATE keywords are required to specify "
63 "the scope of the following arguments. PRIVATE and PUBLIC items will "
64 "populate the COMPILE_DEFINITIONS property of <target>. PUBLIC and "
65 "INTERFACE items will populate the INTERFACE_COMPILE_DEFINITIONS "
66 "property of <target>. "
67 "The following arguments specify compile definitions. "
68 "Repeated calls for the same <target> append items in the order called."
70 "Arguments to target_compile_definitions may use \"generator "
71 "expressions\" with the syntax \"$<...>\". "
72 CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
76 cmTypeMacro(cmTargetCompileDefinitionsCommand, cmTargetPropCommandBase);
79 virtual void HandleImportedTarget(const std::string &tgt);
80 virtual void HandleMissingTarget(const std::string &name);
82 virtual void HandleDirectContent(cmTarget *tgt,
83 const std::vector<std::string> &content,
84 bool prepend, bool system);
85 virtual std::string Join(const std::vector<std::string> &content);