cmCustomCommand.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2001 Insight Consortium
  8. All rights reserved.
  9. Redistribution and use in source and binary forms, with or without
  10. modification, are permitted provided that the following conditions are met:
  11. * Redistributions of source code must retain the above copyright notice,
  12. this list of conditions and the following disclaimer.
  13. * Redistributions in binary form must reproduce the above copyright notice,
  14. this list of conditions and the following disclaimer in the documentation
  15. and/or other materials provided with the distribution.
  16. * The name of the Insight Consortium, nor the names of any consortium members,
  17. nor of any contributors, may be used to endorse or promote products derived
  18. from this software without specific prior written permission.
  19. * Modified source versions must be plainly marked as such, and must not be
  20. misrepresented as being the original software.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
  22. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
  25. ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  27. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  28. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  29. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. =========================================================================*/
  32. #ifndef cmCustomCommand_h
  33. #define cmCustomCommand_h
  34. #include "cmStandardIncludes.h"
  35. class cmMakefile;
  36. /** \class cmCustomCommand
  37. * \brief A class to encapsulate a custom command
  38. *
  39. * cmCustomCommand encapsulates the properties of a custom command
  40. */
  41. class cmCustomCommand
  42. {
  43. public:
  44. cmCustomCommand(const char *src, const char *command,
  45. const char* arguments,
  46. std::vector<std::string> dep,
  47. std::vector<std::string> out);
  48. cmCustomCommand(const cmCustomCommand& r);
  49. /**
  50. * Use the cmMakefile's Expand commands to expand any variables in
  51. * this objects members.
  52. */
  53. void ExpandVariables(const cmMakefile &);
  54. /**
  55. * Return the name of the source file. I'm not sure if this is a full path or not.
  56. */
  57. std::string GetSourceName() const {return m_Source;}
  58. void SetSourceName(const char *name) {m_Source = name;}
  59. ///! Return the command to execute with arguments
  60. std::string GetCommandAndArguments() const
  61. {return m_Command + " " + m_Arguments;}
  62. ///! Return the command to execute
  63. std::string GetCommand() const {return m_Command;}
  64. void SetCommand(const char *cmd) {m_Command = cmd;}
  65. ///! Return the commands arguments
  66. std::string GetArguments() const {return m_Arguments;}
  67. void SetArguments(const char *arg) {m_Arguments = arg;}
  68. /**
  69. * Return the vector that holds the list of dependencies
  70. */
  71. const std::vector<std::string> &GetDepends() const {return m_Depends;}
  72. std::vector<std::string> &GetDepends() {return m_Depends;}
  73. /**
  74. * Return the vector that holds the list of outputs of this command
  75. */
  76. const std::vector<std::string> &GetOutputs() const {return m_Outputs;}
  77. std::vector<std::string> &GetOutputs() {return m_Outputs;}
  78. private:
  79. std::string m_Source;
  80. std::string m_Command;
  81. std::string m_Arguments;
  82. std::vector<std::string> m_Depends;
  83. std::vector<std::string> m_Outputs;
  84. };
  85. #endif