packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmTargetIncludeDirectoriesCommand.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2013 Stephen Kelly <steveire@gmail.com>
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
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 ============================================================================*/
12
13 #ifndef cmTargetIncludeDirectoriesCommand_h
14 #define cmTargetIncludeDirectoriesCommand_h
15
16 #include "cmTargetPropCommandBase.h"
17
18 //----------------------------------------------------------------------------
19 class cmTargetIncludeDirectoriesCommand : public cmTargetPropCommandBase
20 {
21 public:
22   /**
23    * This is a virtual constructor for the command.
24    */
25   virtual cmCommand* Clone()
26     {
27     return new cmTargetIncludeDirectoriesCommand;
28     }
29
30   /**
31    * This is called when the command is first encountered in
32    * the CMakeLists.txt file.
33    */
34   virtual bool InitialPass(std::vector<std::string> const& args,
35                            cmExecutionStatus &status);
36
37   /**
38    * The name of the command as specified in CMakeList.txt.
39    */
40   virtual const char* GetName() const { return "target_include_directories";}
41
42   /**
43    * Succinct documentation.
44    */
45   virtual const char* GetTerseDocumentation() const
46     {
47     return
48       "Add include directories to a target.";
49     }
50
51   /**
52    * More documentation.
53    */
54   virtual const char* GetFullDocumentation() const
55     {
56     return
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 "
61       "target.  "
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."
82       "\n"
83       "Arguments to target_include_directories may use \"generator "
84       "expressions\" with the syntax \"$<...>\".  "
85       CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
86       ;
87     }
88
89   cmTypeMacro(cmTargetIncludeDirectoriesCommand, cmTargetPropCommandBase);
90
91 private:
92   virtual void HandleImportedTarget(const std::string &tgt);
93   virtual void HandleMissingTarget(const std::string &name);
94
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);
101
102   virtual std::string Join(const std::vector<std::string> &content);
103 };
104
105 #endif