cmCustomCommand.cxx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #include "cmCustomCommand.h"
  14. #include "cmMakefile.h"
  15. /**
  16. * The constructor
  17. */
  18. cmCustomCommand::cmCustomCommand(const char *src, const char *command,
  19. const char* arguments,
  20. std::vector<std::string> dep,
  21. std::vector<std::string> out):
  22. m_Source(src),
  23. m_Command(command),
  24. m_Arguments(arguments),
  25. m_Depends(dep),
  26. m_Outputs(out)
  27. {
  28. }
  29. /**
  30. * Copy constructor.
  31. */
  32. cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
  33. m_Source(r.m_Source),
  34. m_Command(r.m_Command),
  35. m_Arguments(r.m_Arguments),
  36. m_Depends(r.m_Depends),
  37. m_Outputs(r.m_Outputs)
  38. {
  39. }
  40. void cmCustomCommand::ExpandVariables(const cmMakefile &mf)
  41. {
  42. mf.ExpandVariablesInString(m_Source);
  43. mf.ExpandVariablesInString(m_Command);
  44. mf.ExpandVariablesInString(m_Arguments);
  45. for (std::vector<std::string>::iterator i = m_Depends.begin();
  46. i != m_Depends.end(); ++i)
  47. {
  48. mf.ExpandVariablesInString(*i);
  49. }
  50. for (std::vector<std::string>::iterator i = m_Outputs.begin();
  51. i != m_Outputs.end(); ++i)
  52. {
  53. mf.ExpandVariablesInString(*i);
  54. }
  55. }