2009-10-02 01:21:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2001-05-04 19:34:59 +04:00
|
|
|
|
2009-10-02 01:21:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2001-05-04 19:34:59 +04:00
|
|
|
|
2009-10-02 01:21: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.
|
|
|
|
============================================================================*/
|
2001-05-08 02:11:16 +04:00
|
|
|
#ifndef cmExecProgramCommand_h
|
|
|
|
#define cmExecProgramCommand_h
|
2001-05-04 19:34:59 +04:00
|
|
|
|
|
|
|
#include "cmCommand.h"
|
|
|
|
|
2001-05-08 02:11:16 +04:00
|
|
|
/** \class cmExecProgramCommand
|
2001-05-04 19:34:59 +04:00
|
|
|
* \brief Command that adds a target to the build system.
|
|
|
|
*
|
2001-05-08 02:11:16 +04:00
|
|
|
* cmExecProgramCommand adds an extra target to the build system.
|
2001-05-04 19:34:59 +04:00
|
|
|
* This is useful when you would like to add special
|
|
|
|
* targets like "install,", "clean," and so on.
|
|
|
|
*/
|
2001-05-08 02:11:16 +04:00
|
|
|
class cmExecProgramCommand : public cmCommand
|
2001-05-04 19:34:59 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* This is a virtual constructor for the command.
|
|
|
|
*/
|
|
|
|
virtual cmCommand* Clone()
|
|
|
|
{
|
2001-05-08 02:11:16 +04:00
|
|
|
return new cmExecProgramCommand;
|
2001-05-04 19:34:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is called when the command is first encountered in
|
|
|
|
* the CMakeLists.txt file.
|
|
|
|
*/
|
2008-01-23 18:28:26 +03:00
|
|
|
virtual bool InitialPass(std::vector<std::string> const& args,
|
|
|
|
cmExecutionStatus &status);
|
2001-05-04 19:34:59 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the command as specified in CMakeList.txt.
|
|
|
|
*/
|
|
|
|
virtual const char* GetName()
|
2007-10-10 19:47:43 +04:00
|
|
|
{return "exec_program";}
|
2001-05-04 19:34:59 +04:00
|
|
|
|
2004-02-23 06:07:02 +03:00
|
|
|
/**
|
|
|
|
* This determines if the command is invoked when in script mode.
|
|
|
|
*/
|
|
|
|
virtual bool IsScriptable() { return true; }
|
|
|
|
|
2001-05-04 19:34:59 +04:00
|
|
|
/**
|
|
|
|
* Succinct documentation.
|
|
|
|
*/
|
|
|
|
virtual const char* GetTerseDocumentation()
|
|
|
|
{
|
2006-03-10 21:54:57 +03:00
|
|
|
return
|
2007-10-10 19:47:43 +04:00
|
|
|
"Deprecated. Use the execute_process() command instead.";
|
2001-05-04 19:34:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* More documentation.
|
|
|
|
*/
|
|
|
|
virtual const char* GetFullDocumentation()
|
|
|
|
{
|
|
|
|
return
|
2007-06-08 17:19:19 +04:00
|
|
|
"Run an executable program during the processing of the CMakeList.txt"
|
2007-01-24 21:45:42 +03:00
|
|
|
" file.\n"
|
2007-10-10 19:47:43 +04:00
|
|
|
" exec_program(Executable [directory in which to run]\n"
|
2003-02-15 02:47:16 +03:00
|
|
|
" [ARGS <arguments to executable>]\n"
|
|
|
|
" [OUTPUT_VARIABLE <var>]\n"
|
|
|
|
" [RETURN_VALUE <var>])\n"
|
2005-11-16 18:40:16 +03:00
|
|
|
"The executable is run in the optionally specified directory. The "
|
2003-02-15 02:47:16 +03:00
|
|
|
"executable can include arguments if it is double quoted, but it is "
|
|
|
|
"better to use the optional ARGS argument to specify arguments to the "
|
|
|
|
"program. This is because cmake will then be able to escape spaces "
|
2005-11-16 18:40:16 +03:00
|
|
|
"in the executable path. An optional argument OUTPUT_VARIABLE "
|
2003-02-15 02:47:16 +03:00
|
|
|
"specifies a variable in which to store the output. "
|
2005-11-16 18:40:16 +03:00
|
|
|
"To capture the return value of the execution, provide a RETURN_VALUE. "
|
|
|
|
"If OUTPUT_VARIABLE is specified, then no output will go to the "
|
2006-02-10 19:43:35 +03:00
|
|
|
"stdout/stderr of the console running cmake.\n"
|
|
|
|
;
|
2001-05-04 19:34:59 +04:00
|
|
|
}
|
|
|
|
|
2006-09-01 17:51:28 +04:00
|
|
|
/** This command is kept for compatibility with older CMake versions. */
|
2006-08-31 21:20:12 +04:00
|
|
|
virtual bool IsDiscouraged()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2001-05-08 02:11:16 +04:00
|
|
|
cmTypeMacro(cmExecProgramCommand, cmCommand);
|
2001-05-04 19:34:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|