1
/*============================================================================
2
CMake - Cross Platform Makefile Generator
3
Copyright 2013 Stephen Kelly <steveire@gmail.com>
5
Distributed under the OSI-approved BSD License (the "License");
6
see accompanying file Copyright.txt for details.
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
============================================================================*/
13
#ifndef cmTargetCompileOptionsCommand_h
14
#define cmTargetCompileOptionsCommand_h
16
#include "cmTargetPropCommandBase.h"
18
class cmTargetCompileOptionsCommand : public cmTargetPropCommandBase
22
* This is a virtual constructor for the command.
24
virtual cmCommand* Clone()
26
return new cmTargetCompileOptionsCommand;
30
* This is called when the command is first encountered in
31
* the CMakeLists.txt file.
33
virtual bool InitialPass(std::vector<std::string> const& args,
34
cmExecutionStatus &status);
37
* The name of the command as specified in CMakeList.txt.
39
virtual const char* GetName() const { return "target_compile_options";}
42
* Succinct documentation.
44
virtual const char* GetTerseDocumentation() const
47
"Add compile options to a target.";
53
virtual const char* GetFullDocumentation() const
56
" target_compile_options(<target> [BEFORE] "
57
"<INTERFACE|PUBLIC|PRIVATE> [items1...]\n"
58
" [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])\n"
59
"Specify compile options to use when compiling a given target. "
60
"The named <target> must have been created by a command such as "
61
"add_executable or add_library and must not be an IMPORTED target. "
62
"If BEFORE is specified, the content will be prepended to the property "
63
"instead of being appended.\n"
64
"The INTERFACE, PUBLIC and PRIVATE keywords are required to specify "
65
"the scope of the following arguments. PRIVATE and PUBLIC items will "
66
"populate the COMPILE_OPTIONS property of <target>. PUBLIC and "
67
"INTERFACE items will populate the INTERFACE_COMPILE_OPTIONS "
68
"property of <target>. "
69
"The following arguments specify compile opitions. "
70
"Repeated calls for the same <target> append items in the order called."
72
"Arguments to target_compile_options may use \"generator "
73
"expressions\" with the syntax \"$<...>\". "
74
CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
78
cmTypeMacro(cmTargetCompileOptionsCommand, cmTargetPropCommandBase);
81
virtual void HandleImportedTarget(const std::string &tgt);
82
virtual void HandleMissingTarget(const std::string &name);
84
virtual void HandleDirectContent(cmTarget *tgt,
85
const std::vector<std::string> &content,
86
bool prepend, bool system);
87
virtual std::string Join(const std::vector<std::string> &content);