Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmCustomCommand.h
blob25dea6b6df8071b4d69b1e15797056de9b485e78
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCustomCommand.h,v $
5 Language: C++
6 Date: $Date: 2007/09/17 14:50:46 $
7 Version: $Revision: 1.23 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmCustomCommand_h
18 #define cmCustomCommand_h
20 #include "cmStandardIncludes.h"
22 /** \class cmCustomCommand
23 * \brief A class to encapsulate a custom command
25 * cmCustomCommand encapsulates the properties of a custom command
27 class cmCustomCommand
29 public:
30 /** Default and copy constructors for STL containers. */
31 cmCustomCommand();
32 cmCustomCommand(const cmCustomCommand& r);
34 /** Main constructor specifies all information for the command. */
35 cmCustomCommand(const std::vector<std::string>& outputs,
36 const std::vector<std::string>& depends,
37 const cmCustomCommandLines& commandLines,
38 const char* comment,
39 const char* workingDirectory);
41 /** Get the output file produced by the command. */
42 const std::vector<std::string>& GetOutputs() const;
44 /** Get the working directory. */
45 const char* GetWorkingDirectory() const;
47 /** Get the vector that holds the list of dependencies. */
48 const std::vector<std::string>& GetDepends() const;
50 /** Get the list of command lines. */
51 const cmCustomCommandLines& GetCommandLines() const;
53 /** Get the comment string for the command. */
54 const char* GetComment() const;
56 /** Append to the list of command lines. */
57 void AppendCommands(const cmCustomCommandLines& commandLines);
59 /** Append to the list of dependencies. */
60 void AppendDepends(const std::vector<std::string>& depends);
62 /** Set/Get whether old-style escaping should be used. */
63 bool GetEscapeOldStyle() const;
64 void SetEscapeOldStyle(bool b);
66 /** Set/Get whether the build tool can replace variables in
67 arguments to the command. */
68 bool GetEscapeAllowMakeVars() const;
69 void SetEscapeAllowMakeVars(bool b);
71 typedef std::pair<cmStdString, cmStdString> ImplicitDependsPair;
72 class ImplicitDependsList: public std::vector<ImplicitDependsPair> {};
73 void SetImplicitDepends(ImplicitDependsList const&);
74 void AppendImplicitDepends(ImplicitDependsList const&);
75 ImplicitDependsList const& GetImplicitDepends() const;
77 private:
78 std::vector<std::string> Outputs;
79 std::vector<std::string> Depends;
80 cmCustomCommandLines CommandLines;
81 bool HaveComment;
82 std::string Comment;
83 std::string WorkingDirectory;
84 bool EscapeAllowMakeVars;
85 bool EscapeOldStyle;
86 ImplicitDependsList ImplicitDepends;
89 #endif