Imported Upstream version 2.8.9
[platform/upstream/cmake.git] / Source / cmIncludeDirectoryCommand.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
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 #ifndef cmIncludeDirectoryCommand_h
13 #define cmIncludeDirectoryCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmIncludeDirectoryCommand
18  * \brief Add include directories to the build.
19  *
20  * cmIncludeDirectoryCommand is used to specify directory locations
21  * to search for included files.
22  */
23 class cmIncludeDirectoryCommand : public cmCommand
24 {
25 public:
26   /**
27    * This is a virtual constructor for the command.
28    */
29   virtual cmCommand* Clone() 
30     {
31     return new cmIncludeDirectoryCommand;
32     }
33
34   /**
35    * This is called when the command is first encountered in
36    * the CMakeLists.txt file.
37    */
38   virtual bool InitialPass(std::vector<std::string> const& args,
39                            cmExecutionStatus &status);
40
41   /**
42    * The name of the command as specified in CMakeList.txt.
43    */
44   virtual const char* GetName() const { return "include_directories";}
45
46   /**
47    * Succinct documentation.
48    */
49   virtual const char* GetTerseDocumentation() const
50     {
51     return "Add include directories to the build.";
52     }
53   
54   /**
55    * More documentation.
56    */
57   virtual const char* GetFullDocumentation() const
58     {
59     return
60       "  include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)\n"
61       "Add the given directories to those the compiler uses to search "
62       "for include files. "
63       "These directories are added to the directory property "
64       "INCLUDE_DIRECTORIES for the current CMakeLists file. "
65       "They are also added to the target property INCLUDE_DIRECTORIES "
66       "for each target in the current CMakeLists file. "
67       "The target property values are the ones used by the generators."
68       "\n"
69       "By default the directories are appended onto the current list of "
70       "directories. "
71       "This default behavior can be changed by setting "
72       "CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. "
73       "By using AFTER or BEFORE explicitly, you can select between "
74       "appending and prepending, independent of the default. "
75       "If the SYSTEM option is given, the compiler will be told the "
76       "directories are meant as system include directories on some "
77       "platforms.";
78     }
79   
80   cmTypeMacro(cmIncludeDirectoryCommand, cmCommand);
81
82 protected:
83   // used internally
84   void AddDirectory(const char *arg, bool before, bool system);
85 };
86
87
88
89 #endif