2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2006-12-07 17:45:32 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2006-12-07 17:45:32 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
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.
|
|
|
|
============================================================================*/
|
2006-12-07 17:45:32 +03:00
|
|
|
#ifndef cmDefinesPropertyCommand_h
|
|
|
|
#define cmDefinesPropertyCommand_h
|
|
|
|
|
|
|
|
#include "cmCommand.h"
|
|
|
|
|
|
|
|
class cmDefinePropertyCommand : public cmCommand
|
|
|
|
{
|
|
|
|
public:
|
2012-08-13 21:42:58 +04:00
|
|
|
virtual cmCommand* Clone()
|
2006-12-07 17:45:32 +03:00
|
|
|
{
|
|
|
|
return new cmDefinePropertyCommand;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is called when the command is first encountered in
|
|
|
|
* the input file.
|
|
|
|
*/
|
2008-01-23 18:28:26 +03:00
|
|
|
virtual bool InitialPass(std::vector<std::string> const& args,
|
|
|
|
cmExecutionStatus &status);
|
2006-12-07 17:45:32 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the command as specified in CMakeList.txt.
|
|
|
|
*/
|
2012-02-25 10:49:24 +04:00
|
|
|
virtual const char* GetName() const { return "define_property";}
|
2006-12-07 17:45:32 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Succinct documentation.
|
|
|
|
*/
|
2012-02-25 10:49:24 +04:00
|
|
|
virtual const char* GetTerseDocumentation() const
|
2006-12-07 17:45:32 +03:00
|
|
|
{
|
2008-02-14 21:36:23 +03:00
|
|
|
return "Define and document custom properties.";
|
2006-12-07 17:45:32 +03:00
|
|
|
}
|
2012-08-13 21:42:58 +04:00
|
|
|
|
2006-12-07 17:45:32 +03:00
|
|
|
/**
|
|
|
|
* Longer documentation.
|
|
|
|
*/
|
2012-02-25 10:49:24 +04:00
|
|
|
virtual const char* GetFullDocumentation() const
|
2006-12-07 17:45:32 +03:00
|
|
|
{
|
|
|
|
return
|
2008-02-14 21:36:23 +03:00
|
|
|
" define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |\n"
|
|
|
|
" TEST | VARIABLE | CACHED_VARIABLE>\n"
|
|
|
|
" PROPERTY <name> [INHERITED]\n"
|
2009-06-16 00:12:27 +04:00
|
|
|
" BRIEF_DOCS <brief-doc> [docs...]\n"
|
|
|
|
" FULL_DOCS <full-doc> [docs...])\n"
|
2008-02-14 21:36:23 +03:00
|
|
|
"Define one property in a scope for use with the "
|
|
|
|
"set_property and get_property commands. "
|
|
|
|
"This is primarily useful to associate documentation with property "
|
|
|
|
"names that may be retrieved with the get_property command. "
|
|
|
|
"The first argument determines the kind of scope in which the "
|
|
|
|
"property should be used. It must be one of the following:\n"
|
|
|
|
" GLOBAL = associated with the global namespace\n"
|
|
|
|
" DIRECTORY = associated with one directory\n"
|
|
|
|
" TARGET = associated with one target\n"
|
|
|
|
" SOURCE = associated with one source file\n"
|
2009-09-03 23:29:29 +04:00
|
|
|
" TEST = associated with a test named with add_test\n"
|
2008-02-14 21:36:23 +03:00
|
|
|
" VARIABLE = documents a CMake language variable\n"
|
|
|
|
" CACHED_VARIABLE = documents a CMake cache variable\n"
|
|
|
|
"Note that unlike set_property and get_property no actual scope "
|
|
|
|
"needs to be given; only the kind of scope is important.\n"
|
|
|
|
"The required PROPERTY option is immediately followed by the name "
|
|
|
|
"of the property being defined.\n"
|
|
|
|
"If the INHERITED option then the get_property command will chain "
|
|
|
|
"up to the next higher scope when the requested property is not "
|
|
|
|
"set in the scope given to the command. "
|
|
|
|
"DIRECTORY scope chains to GLOBAL. "
|
|
|
|
"TARGET, SOURCE, and TEST chain to DIRECTORY.\n"
|
|
|
|
"The BRIEF_DOCS and FULL_DOCS options are followed by strings to be "
|
|
|
|
"associated with the property as its brief and full documentation. "
|
|
|
|
"Corresponding options to the get_property command will retrieve the "
|
|
|
|
"documentation.";
|
2006-12-07 17:45:32 +03:00
|
|
|
}
|
2012-08-13 21:42:58 +04:00
|
|
|
|
2006-12-07 17:45:32 +03:00
|
|
|
cmTypeMacro(cmDefinePropertyCommand, cmCommand);
|
2008-02-14 21:36:23 +03:00
|
|
|
private:
|
|
|
|
std::string PropertyName;
|
|
|
|
std::string BriefDocs;
|
|
|
|
std::string FullDocs;
|
2006-12-07 17:45:32 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|