cmCustomCommand.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 *src, const char *command,
  26. const char* arguments,
  27. std::vector<std::string> dep,
  28. std::vector<std::string> out);
  29. cmCustomCommand(const cmCustomCommand& r);
  30. /**
  31. * Use the cmMakefile's Expand commands to expand any variables in
  32. * this objects members.
  33. */
  34. void ExpandVariables(const cmMakefile &);
  35. /**
  36. * Return the name of the source file. I'm not sure if this is a full path or not.
  37. */
  38. std::string GetSourceName() const {return m_Source;}
  39. void SetSourceName(const char *name) {m_Source = name;}
  40. ///! Return the command to execute with arguments
  41. std::string GetCommandAndArguments() const
  42. {return m_Command + " " + m_Arguments;}
  43. ///! Return the command to execute
  44. std::string GetCommand() const {return m_Command;}
  45. void SetCommand(const char *cmd) {m_Command = cmd;}
  46. ///! Return the command to execute
  47. std::string GetComment() const {return m_Comment;}
  48. void SetComment(const char *cm) {m_Comment = cm;}
  49. ///! Return the commands arguments
  50. std::string GetArguments() const {return m_Arguments;}
  51. void SetArguments(const char *arg) {m_Arguments = arg;}
  52. /**
  53. * Return the vector that holds the list of dependencies
  54. */
  55. const std::vector<std::string> &GetDepends() const {return m_Depends;}
  56. std::vector<std::string> &GetDepends() {return m_Depends;}
  57. /**
  58. * Return the vector that holds the list of outputs of this command
  59. */
  60. const std::vector<std::string> &GetOutputs() const {return m_Outputs;}
  61. std::vector<std::string> &GetOutputs() {return m_Outputs;}
  62. private:
  63. std::string m_Source;
  64. std::string m_Command;
  65. std::string m_Arguments;
  66. std::string m_Comment;
  67. std::vector<std::string> m_Depends;
  68. std::vector<std::string> m_Outputs;
  69. };
  70. #endif