packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmAddDefinitionsCommand.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 cmAddDefinitionsCommand_h
13 #define cmAddDefinitionsCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmAddDefinitionsCommand
18  * \brief Specify a list of compiler defines
19  *
20  * cmAddDefinitionsCommand specifies a list of compiler defines. These defines
21  * will be added to the compile command.
22  */
23 class cmAddDefinitionsCommand : public cmCommand
24 {
25 public:
26   /**
27    * This is a virtual constructor for the command.
28    */
29   virtual cmCommand* Clone()
30     {
31     return new cmAddDefinitionsCommand;
32     }
33
34   /**
35    * This is called when the command is first encountered in
36    * the CMakeLists.txt file.
37    */
38   virtual bool InitialPass(std::vector<std::string> const& args,
39                            cmExecutionStatus &status);
40
41   /**
42    * The name of the command as specified in CMakeList.txt.
43    */
44   virtual const char* GetName() const {return "add_definitions";}
45
46   /**
47    * Succinct documentation.
48    */
49   virtual const char* GetTerseDocumentation() const
50     {
51     return "Adds -D define flags to the compilation of source files.";
52     }
53
54   /**
55    * More documentation.
56    */
57   virtual const char* GetFullDocumentation() const
58     {
59     return
60       "  add_definitions(-DFOO -DBAR ...)\n"
61       "Adds flags to the compiler command line for sources in the current "
62       "directory and below.  This command can be used to add any flags, "
63       "but it was originally intended to add preprocessor definitions.  "
64       "Flags beginning in -D or /D that look like preprocessor definitions "
65       "are automatically added to the COMPILE_DEFINITIONS property for "
66       "the current directory.  Definitions with non-trivial values may be "
67       "left in the set of flags instead of being converted for reasons of "
68       "backwards compatibility.  See documentation of the directory, "
69       "target, and source file COMPILE_DEFINITIONS properties for details "
70       "on adding preprocessor definitions to specific scopes and "
71       "configurations."
72       ;
73     }
74
75   cmTypeMacro(cmAddDefinitionsCommand, cmCommand);
76 };
77
78
79
80 #endif