packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmEnableLanguageCommand.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 cmEnableLanguageCommand_h
13 #define cmEnableLanguageCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmEnableLanguageCommand
18  * \brief Specify the name for this build project.
19  *
20  * cmEnableLanguageCommand 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 cmEnableLanguageCommand : public cmCommand
26 {
27 public:
28   /**
29    * This is a virtual constructor for the command.
30    */
31   virtual cmCommand* Clone()
32     {
33     return new cmEnableLanguageCommand;
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 "enable_language";}
47
48   /**
49    * Succinct documentation.
50    */
51   virtual const char* GetTerseDocumentation() const
52     {
53     return "Enable a language (CXX/C/Fortran/etc)";
54     }
55
56   /**
57    * More documentation.
58    */
59   virtual const char* GetFullDocumentation() const
60     {
61     return
62       "  enable_language(<lang> [OPTIONAL] )\n"
63       "This command enables support for the named language in CMake. "
64       "This is the same as the project command but does not create "
65       "any of the extra variables that are created by the project command. "
66       "Example languages are CXX, C, Fortran. "
67       "\n"
68       "This command must be called in file scope, not in a function call.  "
69       "Furthermore, it must be called in the highest directory common to "
70       "all targets using the named language directly for compiling sources "
71       "or indirectly through link dependencies.  "
72       "It is simplest to enable all needed languages in the top-level "
73       "directory of a project."
74       "\n"
75       "The OPTIONAL keyword is a placeholder for future implementation "
76       "and does not currently work.";
77     }
78
79   cmTypeMacro(cmEnableLanguageCommand, cmCommand);
80 };
81
82
83
84 #endif