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 cmIncludeCommand_h
13 #define cmIncludeCommand_h
15 #include "cmCommand.h"
17 /** \class cmIncludeCommand
20 * cmIncludeCommand defines a list of distant
21 * files that can be "included" in the current list file.
22 * In almost every sense, this is identical to a C/C++
23 * #include command. Arguments are first expended as usual.
25 class cmIncludeCommand : public cmCommand
29 * This is a virtual constructor for the command.
31 virtual cmCommand* Clone()
33 return new cmIncludeCommand;
37 * This is called when the command is first encountered in
38 * the CMakeLists.txt file.
40 virtual bool InitialPass(std::vector<std::string> const& args,
41 cmExecutionStatus &status);
44 * This determines if the command is invoked when in script mode.
46 virtual bool IsScriptable() const { return true; }
49 * The name of the command as specified in CMakeList.txt.
51 virtual const char* GetName() const {return "include";}
54 * Succinct documentation.
56 virtual const char* GetTerseDocumentation() const
58 return "Load and run CMake code from a file or module.";
64 virtual const char* GetFullDocumentation() const
67 " include(<file|module> [OPTIONAL] [RESULT_VARIABLE <VAR>]\n"
68 " [NO_POLICY_SCOPE])\n"
69 "Load and run CMake code from the file given. "
70 "Variable reads and writes access the scope of the caller "
72 "If OPTIONAL is present, then no error "
73 "is raised if the file does not exist. If RESULT_VARIABLE is given "
74 "the variable will be set to the full filename which "
75 "has been included or NOTFOUND if it failed.\n"
76 "If a module is specified instead of a file, the file with name "
77 "<modulename>.cmake is searched first in CMAKE_MODULE_PATH, then in the "
78 "CMake module directory. There is one exception to this: if the file "
79 "which calls include() is located itself in the CMake module directory, "
80 "then first the CMake module directory is searched and "
81 "CMAKE_MODULE_PATH afterwards. See also policy CMP0017."
83 "See the cmake_policy() command documentation for discussion of the "
84 "NO_POLICY_SCOPE option."
88 cmTypeMacro(cmIncludeCommand, cmCommand);