packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmProjectCommand.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 cmProjectCommand_h
13 #define cmProjectCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmProjectCommand
18  * \brief Specify the name for this build project.
19  *
20  * cmProjectCommand is used to specify a name for this build project.
21  * It is defined once per set of CMakeList.txt files (including
22  * all subdirectories). Currently it just sets the name of the workspace
23  * file for Microsoft Visual C++
24  */
25 class cmProjectCommand : public cmCommand
26 {
27 public:
28   /**
29    * This is a virtual constructor for the command.
30    */
31   virtual cmCommand* Clone()
32     {
33     return new cmProjectCommand;
34     }
35
36   /**
37    * This is called when the command is first encountered in
38    * the CMakeLists.txt file.
39    */
40   virtual bool InitialPass(std::vector<std::string> const& args,
41                            cmExecutionStatus &status);
42
43   /**
44    * The name of the command as specified in CMakeList.txt.
45    */
46   virtual const char* GetName() const {return "project";}
47
48   /**
49    * Succinct documentation.
50    */
51   virtual const char* GetTerseDocumentation() const
52     {
53     return "Set a name for the entire project.";
54     }
55
56   /**
57    * More documentation.
58    */
59   virtual const char* GetFullDocumentation() const
60     {
61     return
62       "  project(<projectname> [languageName1 languageName2 ... ] )\n"
63       "Sets the name of the project.  "
64       "Additionally this sets the variables <projectName>_BINARY_DIR and "
65       "<projectName>_SOURCE_DIR to the respective values.\n"
66       "Optionally you can specify which languages your project supports.  "
67       "Example languages are CXX (i.e. C++), C, Fortran, etc. "
68       "By default C and CXX are enabled.  E.g. if you do not have a "
69       "C++ compiler, you can disable the check for it by explicitly listing "
70       "the languages you want to support, e.g. C.  By using the special "
71       "language \"NONE\" all checks for any language can be disabled. "
72       "If a variable exists called CMAKE_PROJECT_<projectName>_INCLUDE, "
73       "the file pointed to by that variable will be included as the last step "
74       "of the project command."
75       "\n"
76       "The top-level CMakeLists.txt file for a project must contain a "
77       "literal, direct call to the project() command; loading one through "
78       "the include() command is not sufficient.  "
79       "If no such call exists CMake will implicitly add one to the top that "
80       "enables the default languages (C and CXX).";
81     }
82
83   cmTypeMacro(cmProjectCommand, cmCommand);
84 };
85
86
87
88 #endif