2001-04-11 22:59:02 +04:00
|
|
|
/*=========================================================================
|
|
|
|
|
2002-10-24 02:03:27 +04:00
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
2001-04-11 22:59:02 +04:00
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
2002-10-24 02:03:27 +04:00
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
2001-04-11 22:59:02 +04:00
|
|
|
|
2002-01-21 23:30:43 +03:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
2001-04-11 22:59:02 +04:00
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#ifndef cmCustomCommand_h
|
|
|
|
#define cmCustomCommand_h
|
|
|
|
|
|
|
|
#include "cmStandardIncludes.h"
|
|
|
|
class cmMakefile;
|
|
|
|
|
2001-04-19 21:28:46 +04:00
|
|
|
/** \class cmCustomCommand
|
|
|
|
* \brief A class to encapsulate a custom command
|
|
|
|
*
|
|
|
|
* cmCustomCommand encapsulates the properties of a custom command
|
|
|
|
*/
|
2001-04-11 22:59:02 +04:00
|
|
|
class cmCustomCommand
|
|
|
|
{
|
|
|
|
public:
|
2003-06-03 18:30:23 +04:00
|
|
|
cmCustomCommand(const char *command,
|
2001-09-05 00:07:54 +04:00
|
|
|
const char* arguments,
|
2001-04-11 22:59:02 +04:00
|
|
|
std::vector<std::string> dep,
|
2003-06-03 18:30:23 +04:00
|
|
|
const char *out);
|
|
|
|
cmCustomCommand(const char *command,
|
|
|
|
const char* arguments);
|
|
|
|
cmCustomCommand() {};
|
2001-04-11 22:59:02 +04:00
|
|
|
cmCustomCommand(const cmCustomCommand& r);
|
2001-04-19 21:28:46 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Use the cmMakefile's Expand commands to expand any variables in
|
|
|
|
* this objects members.
|
|
|
|
*/
|
2001-04-11 22:59:02 +04:00
|
|
|
void ExpandVariables(const cmMakefile &);
|
2001-04-19 21:28:46 +04:00
|
|
|
|
2001-09-05 00:07:54 +04:00
|
|
|
///! Return the command to execute with arguments
|
|
|
|
std::string GetCommandAndArguments() const
|
|
|
|
{return m_Command + " " + m_Arguments;}
|
|
|
|
|
|
|
|
///! Return the command to execute
|
2003-06-24 00:25:50 +04:00
|
|
|
const std::string &GetCommand() const {return m_Command;}
|
2001-04-19 21:28:46 +04:00
|
|
|
void SetCommand(const char *cmd) {m_Command = cmd;}
|
2001-09-05 00:07:54 +04:00
|
|
|
|
2003-06-03 18:30:23 +04:00
|
|
|
///! Return the output
|
2003-06-24 00:25:50 +04:00
|
|
|
const std::string &GetOutput() const {return m_Output;}
|
2003-06-03 18:30:23 +04:00
|
|
|
void SetOutput(const char *cm) {m_Output = cm;}
|
|
|
|
|
|
|
|
///! Return the comment
|
2003-06-24 00:25:50 +04:00
|
|
|
const std::string &GetComment() const {return m_Comment;}
|
2002-12-11 00:47:37 +03:00
|
|
|
void SetComment(const char *cm) {m_Comment = cm;}
|
|
|
|
|
2001-09-05 00:07:54 +04:00
|
|
|
///! Return the commands arguments
|
2003-06-24 00:25:50 +04:00
|
|
|
const std::string &GetArguments() const {return m_Arguments;}
|
2001-09-05 00:07:54 +04:00
|
|
|
void SetArguments(const char *arg) {m_Arguments = arg;}
|
2001-04-19 21:28:46 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the vector that holds the list of dependencies
|
|
|
|
*/
|
|
|
|
const std::vector<std::string> &GetDepends() const {return m_Depends;}
|
|
|
|
std::vector<std::string> &GetDepends() {return m_Depends;}
|
|
|
|
|
2003-06-04 21:42:42 +04:00
|
|
|
///! Return true if the command and args are equal to the ones here.
|
|
|
|
bool IsEquivalent(const char* command,
|
|
|
|
const char* args);
|
2001-04-19 21:28:46 +04:00
|
|
|
private:
|
2001-04-11 22:59:02 +04:00
|
|
|
std::string m_Command;
|
2001-09-05 00:07:54 +04:00
|
|
|
std::string m_Arguments;
|
2002-12-11 00:47:37 +03:00
|
|
|
std::string m_Comment;
|
2003-06-03 18:30:23 +04:00
|
|
|
std::string m_Output;
|
2001-04-11 22:59:02 +04:00
|
|
|
std::vector<std::string> m_Depends;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|