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 cmTargetIncludeDirectoriesCommand_h
14 #define cmTargetIncludeDirectoriesCommand_h
16 #include "cmTargetPropCommandBase.h"
18 //----------------------------------------------------------------------------
19 class cmTargetIncludeDirectoriesCommand : public cmTargetPropCommandBase
23 * This is a virtual constructor for the command.
25 virtual cmCommand* Clone()
27 return new cmTargetIncludeDirectoriesCommand;
31 * This is called when the command is first encountered in
32 * the CMakeLists.txt file.
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() const { return "target_include_directories";}
43 * Succinct documentation.
45 virtual const char* GetTerseDocumentation() const
48 "Add include directories to a target.";
54 virtual const char* GetFullDocumentation() const
57 " target_include_directories(<target> [SYSTEM] [BEFORE] "
58 "<INTERFACE|PUBLIC|PRIVATE> [items1...]\n"
59 " [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])\n"
60 "Specify include directories or targets to use when compiling a given "
62 "The named <target> must have been created by a command such as "
63 "add_executable or add_library and must not be an IMPORTED target.\n"
64 "If BEFORE is specified, the content will be prepended to the property "
65 "instead of being appended.\n"
66 "The INTERFACE, PUBLIC and PRIVATE keywords are required to specify "
67 "the scope of the following arguments. PRIVATE and PUBLIC items will "
68 "populate the INCLUDE_DIRECTORIES property of <target>. PUBLIC and "
69 "INTERFACE items will populate the INTERFACE_INCLUDE_DIRECTORIES "
70 "property of <target>. "
71 "The following arguments specify include directories. Specified "
72 "include directories may be absolute paths or relative paths. "
73 "Repeated calls for the same <target> append items in the order called."
74 "If SYSTEM is specified, the compiler will be told the "
75 "directories are meant as system include directories on some "
76 "platforms (signalling this setting might achieve effects such as "
77 "the compiler skipping warnings, or these fixed-install system files "
78 "not being considered in dependency calculations - see compiler "
79 "docs). If SYSTEM is used together with PUBLIC or INTERFACE, the "
80 "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property will be "
81 "populated with the specified directories."
83 "Arguments to target_include_directories may use \"generator "
84 "expressions\" with the syntax \"$<...>\". "
85 CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
89 cmTypeMacro(cmTargetIncludeDirectoriesCommand, cmTargetPropCommandBase);
92 virtual void HandleImportedTarget(const std::string &tgt);
93 virtual void HandleMissingTarget(const std::string &name);
95 virtual void HandleDirectContent(cmTarget *tgt,
96 const std::vector<std::string> &content,
97 bool prepend, bool system);
98 virtual void HandleInterfaceContent(cmTarget *tgt,
99 const std::vector<std::string> &content,
100 bool prepend, bool system);
102 virtual std::string Join(const std::vector<std::string> &content);