cmCustomCommand.cxx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #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_Comment(r.m_Comment),
  37. m_Depends(r.m_Depends),
  38. m_Outputs(r.m_Outputs)
  39. {
  40. }
  41. void cmCustomCommand::ExpandVariables(const cmMakefile &mf)
  42. {
  43. mf.ExpandVariablesInString(m_Source);
  44. mf.ExpandVariablesInString(m_Command);
  45. mf.ExpandVariablesInString(m_Arguments);
  46. for (std::vector<std::string>::iterator i = m_Depends.begin();
  47. i != m_Depends.end(); ++i)
  48. {
  49. mf.ExpandVariablesInString(*i);
  50. }
  51. for (std::vector<std::string>::iterator i = m_Outputs.begin();
  52. i != m_Outputs.end(); ++i)
  53. {
  54. mf.ExpandVariablesInString(*i);
  55. }
  56. }