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