packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmBuildCommand.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 cmBuildCommand_h
13 #define cmBuildCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmBuildCommand
18  * \brief build_command command
19  *
20  * cmBuildCommand implements the build_command CMake command
21  */
22 class cmBuildCommand : public cmCommand
23 {
24 public:
25   /**
26    * This is a virtual constructor for the command.
27    */
28   virtual cmCommand* Clone()
29     {
30     return new cmBuildCommand;
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 primary command signature with optional, KEYWORD-based args.
42    */
43   virtual bool MainSignature(std::vector<std::string> const& args);
44
45   /**
46    * Legacy "exactly 2 args required" signature.
47    */
48   virtual bool TwoArgsSignature(std::vector<std::string> const& args);
49
50   /**
51    * The name of the command as specified in CMakeList.txt.
52    */
53   virtual const char* GetName() const {return "build_command";}
54
55   /**
56    * Succinct documentation.
57    */
58   virtual const char* GetTerseDocumentation() const
59     {
60     return "Get the command line to build this project.";
61     }
62
63   /**
64    * More documentation.
65    */
66   virtual const char* GetFullDocumentation() const
67     {
68     return
69       "  build_command(<variable>\n"
70       "                [CONFIGURATION <config>]\n"
71       "                [PROJECT_NAME <projname>]\n"
72       "                [TARGET <target>])\n"
73       "Sets the given <variable> to a string containing the command line "
74       "for building one configuration of a target in a project using the "
75       "build tool appropriate for the current CMAKE_GENERATOR.\n"
76       "If CONFIGURATION is omitted, CMake chooses a reasonable default "
77       "value  for multi-configuration generators.  CONFIGURATION is "
78       "ignored for single-configuration generators.\n"
79       "If PROJECT_NAME is omitted, the resulting command line will build "
80       "the top level PROJECT in the current build tree.\n"
81       "If TARGET is omitted, the resulting command line will build "
82       "everything, effectively using build target 'all' or 'ALL_BUILD'.\n"
83       "  build_command(<cachevariable> <makecommand>)\n"
84       "This second signature is deprecated, but still available for "
85       "backwards compatibility. Use the first signature instead.\n"
86       "Sets the given <cachevariable> to a string containing the command "
87       "to build this project from the root of the build tree using "
88       "the build tool given by <makecommand>.  <makecommand> should be "
89       "the full path to msdev, devenv, nmake, make or one of the end "
90       "user build tools."
91       ;
92     }
93
94   cmTypeMacro(cmBuildCommand, cmCommand);
95 };
96
97 #endif