1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
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 ============================================================================*/
12 #ifndef cmIncludeDirectoryCommand_h
13 #define cmIncludeDirectoryCommand_h
15 #include "cmCommand.h"
17 /** \class cmIncludeDirectoryCommand
18 * \brief Add include directories to the build.
20 * cmIncludeDirectoryCommand is used to specify directory locations
21 * to search for included files.
23 class cmIncludeDirectoryCommand : public cmCommand
27 * This is a virtual constructor for the command.
29 virtual cmCommand* Clone()
31 return new cmIncludeDirectoryCommand;
35 * This is called when the command is first encountered in
36 * the CMakeLists.txt file.
38 virtual bool InitialPass(std::vector<std::string> const& args,
39 cmExecutionStatus &status);
42 * The name of the command as specified in CMakeList.txt.
44 virtual const char* GetName() const { return "include_directories";}
47 * Succinct documentation.
49 virtual const char* GetTerseDocumentation() const
51 return "Add include directories to the build.";
57 virtual const char* GetFullDocumentation() const
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. Relative paths are interpreted as relative to "
63 "the current source directory. \n"
64 "The include directories are added to the directory property "
65 "INCLUDE_DIRECTORIES for the current CMakeLists file. "
66 "They are also added to the target property INCLUDE_DIRECTORIES "
67 "for each target in the current CMakeLists file. "
68 "The target property values are the ones used by the generators."
70 "By default the directories are appended onto the current list of "
72 "This default behavior can be changed by setting "
73 "CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. "
74 "By using AFTER or BEFORE explicitly, you can select between "
75 "appending and prepending, independent of the default. "
77 "If the SYSTEM option is given, the compiler will be told the "
78 "directories are meant as system include directories on some "
79 "platforms (signalling this setting might achieve effects such as "
80 "the compiler skipping warnings, or these fixed-install system files "
81 "not being considered in dependency calculations - see compiler docs).";
84 cmTypeMacro(cmIncludeDirectoryCommand, cmCommand);
88 void GetIncludes(const std::string &arg, std::vector<std::string> &incs);
89 void NormalizeInclude(std::string &inc);