Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Source / cmAddCompileOptionsCommand.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2013 Stephen Kelly <steveire@gmail.com>
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 cmAddCompileOptionsCommand_h
13 #define cmAddCompileOptionsCommand_h
14
15 #include "cmCommand.h"
16 #include "cmDocumentGeneratorExpressions.h"
17
18 class cmAddCompileOptionsCommand : public cmCommand
19 {
20 public:
21   /**
22    * This is a virtual constructor for the command.
23    */
24   virtual cmCommand* Clone()
25     {
26     return new cmAddCompileOptionsCommand;
27     }
28
29   /**
30    * This is called when the command is first encountered in
31    * the CMakeLists.txt file.
32    */
33   virtual bool InitialPass(std::vector<std::string> const& args,
34                            cmExecutionStatus &status);
35
36   /**
37    * The name of the command as specified in CMakeList.txt.
38    */
39   virtual const char* GetName() const {return "add_compile_options";}
40
41   /**
42    * Succinct documentation.
43    */
44   virtual const char* GetTerseDocumentation() const
45     {
46     return "Adds options to the compilation of source files.";
47     }
48
49   /**
50    * More documentation.
51    */
52   virtual const char* GetFullDocumentation() const
53     {
54     return
55       "  add_compile_options(<option> ...)\n"
56       "Adds options to the compiler command line for sources in the "
57       "current directory and below.  This command can be used to add any "
58       "options, but alternative commands exist to add preprocessor "
59       "definitions or include directories.  "
60       "See documentation of the directory and target COMPILE_OPTIONS "
61       "properties for details.  "
62       "Arguments to add_compile_options may use \"generator "
63       "expressions\" with the syntax \"$<...>\".  "
64       CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
65       ;
66     }
67
68   cmTypeMacro(cmAddCompileOptionsCommand, cmCommand);
69 };
70
71 #endif