cmCustomCommand.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 commands arguments
  47. std::string GetArguments() const {return m_Arguments;}
  48. void SetArguments(const char *arg) {m_Arguments = arg;}
  49. /**
  50. * Return the vector that holds the list of dependencies
  51. */
  52. const std::vector<std::string> &GetDepends() const {return m_Depends;}
  53. std::vector<std::string> &GetDepends() {return m_Depends;}
  54. /**
  55. * Return the vector that holds the list of outputs of this command
  56. */
  57. const std::vector<std::string> &GetOutputs() const {return m_Outputs;}
  58. std::vector<std::string> &GetOutputs() {return m_Outputs;}
  59. private:
  60. std::string m_Source;
  61. std::string m_Command;
  62. std::string m_Arguments;
  63. std::vector<std::string> m_Depends;
  64. std::vector<std::string> m_Outputs;
  65. };
  66. #endif