cmCustomCommand.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmCustomCommand_h
  14. #define cmCustomCommand_h
  15. #include "cmStandardIncludes.h"
  16. class cmMakefile;
  17. /** \class cmCustomCommand
  18. * \brief A class to encapsulate a custom command
  19. *
  20. * cmCustomCommand encapsulates the properties of a custom command
  21. */
  22. class cmCustomCommand
  23. {
  24. public:
  25. cmCustomCommand(const char *command,
  26. const char* arguments,
  27. std::vector<std::string> dep,
  28. const char *out);
  29. cmCustomCommand(const char *command,
  30. const char* arguments);
  31. cmCustomCommand() {};
  32. cmCustomCommand(const cmCustomCommand& r);
  33. /**
  34. * Use the cmMakefile's Expand commands to expand any variables in
  35. * this objects members.
  36. */
  37. void ExpandVariables(const cmMakefile &);
  38. ///! Return the command to execute with arguments
  39. std::string GetCommandAndArguments() const
  40. {return m_Command + " " + m_Arguments;}
  41. ///! Return the command to execute
  42. std::string GetCommand() const {return m_Command;}
  43. void SetCommand(const char *cmd) {m_Command = cmd;}
  44. ///! Return the output
  45. std::string GetOutput() const {return m_Output;}
  46. void SetOutput(const char *cm) {m_Output = cm;}
  47. ///! Return the comment
  48. std::string GetComment() const {return m_Comment;}
  49. void SetComment(const char *cm) {m_Comment = cm;}
  50. ///! Return the commands arguments
  51. std::string GetArguments() const {return m_Arguments;}
  52. void SetArguments(const char *arg) {m_Arguments = arg;}
  53. /**
  54. * Return the vector that holds the list of dependencies
  55. */
  56. const std::vector<std::string> &GetDepends() const {return m_Depends;}
  57. std::vector<std::string> &GetDepends() {return m_Depends;}
  58. private:
  59. std::string m_Command;
  60. std::string m_Arguments;
  61. std::string m_Comment;
  62. std::string m_Output;
  63. std::vector<std::string> m_Depends;
  64. };
  65. #endif