cmCustomCommand.cxx 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. //----------------------------------------------------------------------------
  15. cmCustomCommand::cmCustomCommand()
  16. {
  17. m_Used = false;
  18. }
  19. //----------------------------------------------------------------------------
  20. cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
  21. m_Output(r.m_Output),
  22. m_Depends(r.m_Depends),
  23. m_CommandLines(r.m_CommandLines),
  24. m_Comment(r.m_Comment),
  25. m_WorkingDirectory(r.m_WorkingDirectory)
  26. {
  27. m_Used = false;
  28. }
  29. //----------------------------------------------------------------------------
  30. cmCustomCommand::cmCustomCommand(const char* output,
  31. const std::vector<std::string>& depends,
  32. const cmCustomCommandLines& commandLines,
  33. const char* comment, const char* workingDirectory):
  34. m_Output(output?output:""),
  35. m_Depends(depends),
  36. m_CommandLines(commandLines),
  37. m_Comment(comment?comment:""),
  38. m_WorkingDirectory(workingDirectory?workingDirectory:"")
  39. {
  40. m_Used = false;
  41. }
  42. //----------------------------------------------------------------------------
  43. const char* cmCustomCommand::GetOutput() const
  44. {
  45. return m_Output.c_str();
  46. }
  47. //----------------------------------------------------------------------------
  48. const char* cmCustomCommand::GetWorkingDirectory() const
  49. {
  50. if(m_WorkingDirectory.size() == 0)
  51. {
  52. return 0;
  53. }
  54. return m_WorkingDirectory.c_str();
  55. }
  56. //----------------------------------------------------------------------------
  57. const std::vector<std::string>& cmCustomCommand::GetDepends() const
  58. {
  59. return m_Depends;
  60. }
  61. //----------------------------------------------------------------------------
  62. const cmCustomCommandLines& cmCustomCommand::GetCommandLines() const
  63. {
  64. return m_CommandLines;
  65. }
  66. //----------------------------------------------------------------------------
  67. const char* cmCustomCommand::GetComment() const
  68. {
  69. return m_Comment.c_str();
  70. }