2013-01-08 03:34:41 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2013 Stephen Kelly <steveire@gmail.com>
|
|
|
|
|
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
|
|
|
|
|
|
|
#ifndef cmTargetCompileDefinitionsCommand_h
|
|
|
|
#define cmTargetCompileDefinitionsCommand_h
|
|
|
|
|
|
|
|
#include "cmTargetPropCommandBase.h"
|
|
|
|
|
|
|
|
class cmTargetCompileDefinitionsCommand : public cmTargetPropCommandBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* This is a virtual constructor for the command.
|
|
|
|
*/
|
|
|
|
virtual cmCommand* Clone()
|
|
|
|
{
|
|
|
|
return new cmTargetCompileDefinitionsCommand;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is called when the command is first encountered in
|
|
|
|
* the CMakeLists.txt file.
|
|
|
|
*/
|
|
|
|
virtual bool InitialPass(std::vector<std::string> const& args,
|
|
|
|
cmExecutionStatus &status);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the command as specified in CMakeList.txt.
|
|
|
|
*/
|
|
|
|
virtual const char* GetName() const { return "target_compile_definitions";}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Succinct documentation.
|
|
|
|
*/
|
|
|
|
virtual const char* GetTerseDocumentation() const
|
|
|
|
{
|
|
|
|
return
|
|
|
|
"Add compile definitions to a target.";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* More documentation.
|
|
|
|
*/
|
|
|
|
virtual const char* GetFullDocumentation() const
|
|
|
|
{
|
|
|
|
return
|
|
|
|
" target_compile_definitions(<target> "
|
|
|
|
"<INTERFACE|PUBLIC|PRIVATE> [items1...]\n"
|
|
|
|
" [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])\n"
|
2013-03-25 22:23:01 +04:00
|
|
|
"Specify compile definitions to use when compiling a given target. "
|
2013-01-08 03:34:41 +04:00
|
|
|
"The named <target> must have been created by a command such as "
|
2013-01-21 15:28:27 +04:00
|
|
|
"add_executable or add_library and must not be an IMPORTED target. "
|
2013-01-08 03:34:41 +04:00
|
|
|
"The INTERFACE, PUBLIC and PRIVATE keywords are required to specify "
|
|
|
|
"the scope of the following arguments. PRIVATE and PUBLIC items will "
|
|
|
|
"populate the COMPILE_DEFINITIONS property of <target>. PUBLIC and "
|
|
|
|
"INTERFACE items will populate the INTERFACE_COMPILE_DEFINITIONS "
|
|
|
|
"property of <target>. "
|
2013-03-25 22:23:01 +04:00
|
|
|
"The following arguments specify compile definitions. "
|
2013-01-08 03:34:41 +04:00
|
|
|
"Repeated calls for the same <target> append items in the order called."
|
|
|
|
"\n"
|
2013-01-13 13:04:40 +04:00
|
|
|
"Arguments to target_compile_definitions may use \"generator "
|
|
|
|
"expressions\" with the syntax \"$<...>\". "
|
|
|
|
CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
|
2013-05-16 17:52:25 +04:00
|
|
|
CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS
|
2013-01-08 03:34:41 +04:00
|
|
|
;
|
|
|
|
}
|
|
|
|
|
2013-01-31 18:31:58 +04:00
|
|
|
cmTypeMacro(cmTargetCompileDefinitionsCommand, cmTargetPropCommandBase);
|
2013-01-08 03:34:41 +04:00
|
|
|
|
|
|
|
private:
|
2013-01-21 15:28:27 +04:00
|
|
|
virtual void HandleImportedTarget(const std::string &tgt);
|
2013-01-08 03:34:41 +04:00
|
|
|
virtual void HandleMissingTarget(const std::string &name);
|
|
|
|
|
2013-01-29 20:23:31 +04:00
|
|
|
virtual void HandleDirectContent(cmTarget *tgt,
|
|
|
|
const std::vector<std::string> &content,
|
2013-01-20 17:04:13 +04:00
|
|
|
bool prepend, bool system);
|
2013-01-29 20:23:31 +04:00
|
|
|
virtual std::string Join(const std::vector<std::string> &content);
|
2013-01-08 03:34:41 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|