packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmLoadCommandCommand.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 cmLoadCommandCommand_h
13 #define cmLoadCommandCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmLoadCommandCommand
18  * \brief Load in a Command plugin
19  *
20  * cmLoadCommandCommand loads a command into CMake
21  */
22 class cmLoadCommandCommand : public cmCommand
23 {
24 public:
25   /**
26    * This is a virtual constructor for the command.
27    */
28   virtual cmCommand* Clone()
29     {
30     return new cmLoadCommandCommand;
31     }
32
33   /**
34    * This is called when the command is first encountered in
35    * the CMakeLists.txt file.
36    */
37   virtual bool InitialPass(std::vector<std::string> const& args,
38                            cmExecutionStatus &status);
39
40   /**
41    * The name of the command as specified in CMakeList.txt.
42    */
43   virtual const char* GetName() const {return "load_command";}
44
45   /**
46    * Succinct documentation.
47    */
48   virtual const char* GetTerseDocumentation() const
49     {
50     return "Load a command into a running CMake.";
51     }
52
53   /**
54    * More documentation.
55    */
56   virtual const char* GetFullDocumentation() const
57     {
58     return
59       "  load_command(COMMAND_NAME <loc1> [loc2 ...])\n"
60       "The given locations are searched for a library whose name is "
61       "cmCOMMAND_NAME.  If found, it is loaded as a module and the command "
62       "is added to the set of available CMake commands.  Usually, "
63       "TRY_COMPILE is used before this command to compile the module. "
64       "If the command is successfully loaded a variable named\n"
65       "  CMAKE_LOADED_COMMAND_<COMMAND_NAME>\n"
66       "will be set to the full path of the module that was loaded.  "
67       "Otherwise the variable will not be set.";
68     }
69
70   cmTypeMacro(cmLoadCommandCommand, cmCommand);
71 };
72
73
74
75 #endif