cmCustomCommand.cxx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #include "cmCustomCommand.h"
  12. #include "cmMakefile.h"
  13. /**
  14. * The constructor
  15. */
  16. cmCustomCommand::cmCustomCommand(const char *src, const char *command,
  17. std::vector<std::string> dep,
  18. std::vector<std::string> out):
  19. m_Source(src),
  20. m_Command(command),
  21. m_Depends(dep),
  22. m_Outputs(out)
  23. {
  24. }
  25. /**
  26. * Copy constructor.
  27. */
  28. cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
  29. m_Source(r.m_Source),
  30. m_Command(r.m_Command),
  31. m_Depends(r.m_Depends),
  32. m_Outputs(r.m_Outputs)
  33. {
  34. }
  35. void cmCustomCommand::ExpandVariables(const cmMakefile &mf)
  36. {
  37. mf.ExpandVariablesInString(m_Source);
  38. mf.ExpandVariablesInString(m_Command);
  39. for (std::vector<std::string>::iterator i = m_Depends.begin();
  40. i != m_Depends.end(); ++i)
  41. {
  42. mf.ExpandVariablesInString(*i);
  43. }
  44. for (std::vector<std::string>::iterator i = m_Outputs.begin();
  45. i != m_Outputs.end(); ++i)
  46. {
  47. mf.ExpandVariablesInString(*i);
  48. }
  49. }