summaryrefslogtreecommitdiffstats
path: root/Source/cmCustomCommand.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-02-22 15:32:44 (GMT)
committerBrad King <brad.king@kitware.com>2005-02-22 15:32:44 (GMT)
commit39af9ee1e496db77849015541f687897ed819a56 (patch)
tree79bd7c1765408c80822dc9b87853bdac24704332 /Source/cmCustomCommand.h
parent4d30cb309cc0cd191e89a7969599b79dea111a08 (diff)
downloadCMake-39af9ee1e496db77849015541f687897ed819a56.zip
CMake-39af9ee1e496db77849015541f687897ed819a56.tar.gz
CMake-39af9ee1e496db77849015541f687897ed819a56.tar.bz2
ENH: Updated implementation of custom commands. Multiple command lines are now supported effectively allowing entire scripts to be written. Also removed extra variable expansions and cleaned up passing of commands through to the generators. The command and individual arguments are now kept separate all the way until the generator writes them out. This cleans up alot of escaping issues.
Diffstat (limited to 'Source/cmCustomCommand.h')
-rw-r--r--Source/cmCustomCommand.h67
1 files changed, 21 insertions, 46 deletions
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
index 612780e..0a87949 100644
--- a/Source/cmCustomCommand.h
+++ b/Source/cmCustomCommand.h
@@ -9,8 +9,8 @@
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ 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.
=========================================================================*/
@@ -18,7 +18,6 @@
#define cmCustomCommand_h
#include "cmStandardIncludes.h"
-class cmMakefile;
/** \class cmCustomCommand
* \brief A class to encapsulate a custom command
@@ -28,57 +27,33 @@ class cmMakefile;
class cmCustomCommand
{
public:
- cmCustomCommand(const char *command,
- const char* arguments,
- std::vector<std::string> dep,
- const char *out);
- cmCustomCommand(const char *command,
- const char* arguments);
- cmCustomCommand() {};
+ /** Default and copy constructors for STL containers. */
+ cmCustomCommand();
cmCustomCommand(const cmCustomCommand& r);
-
- /**
- * Use the cmMakefile's Expand commands to expand any variables in
- * this objects members.
- */
- void ExpandVariables(const cmMakefile &);
- ///! Return the command to execute with arguments
- std::string GetCommandAndArguments() const
- {return m_Command + " " + m_Arguments;}
-
- ///! Return the command to execute
- const std::string &GetCommand() const {return m_Command;}
- void SetCommand(const char *cmd) {m_Command = cmd;}
+ /** Main constructor specifies all information for the command. */
+ cmCustomCommand(const char* output,
+ const std::vector<std::string>& depends,
+ const cmCustomCommandLines& commandLines,
+ const char* comment);
- ///! Return the output
- const std::string &GetOutput() const {return m_Output;}
- void SetOutput(const char *cm) {m_Output = cm;}
+ /** Get the output file produced by the command. */
+ const char* GetOutput() const;
- ///! Return the comment
- const std::string &GetComment() const {return m_Comment;}
- void SetComment(const char *cm) {m_Comment = cm;}
+ /** Get the vector that holds the list of dependencies. */
+ const std::vector<std::string>& GetDepends() const;
+
+ /** Get the list of command lines. */
+ const cmCustomCommandLines& GetCommandLines() const;
+
+ /** Get the comment string for the command. */
+ const char* GetComment() const;
- ///! Return the commands arguments
- const std::string &GetArguments() const {return m_Arguments;}
- void SetArguments(const char *arg) {m_Arguments = arg;}
-
- /**
- * 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;}
-
- ///! Return true if the command and args are equal to the ones here.
- bool IsEquivalent(const char* command,
- const char* args);
private:
- std::string m_Command;
- std::string m_Arguments;
- std::string m_Comment;
std::string m_Output;
std::vector<std::string> m_Depends;
+ cmCustomCommandLines m_CommandLines;
+ std::string m_Comment;
};
-
#endif