cmCustomCommand.cxx 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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,
  34. const char* workingDirectory):
  35. m_Output(output?output:""),
  36. m_Depends(depends),
  37. m_CommandLines(commandLines),
  38. m_Comment(comment?comment:""),
  39. m_WorkingDirectory(workingDirectory?workingDirectory:"")
  40. {
  41. m_Used = false;
  42. }
  43. //----------------------------------------------------------------------------
  44. const char* cmCustomCommand::GetOutput() const
  45. {
  46. return m_Output.c_str();
  47. }
  48. //----------------------------------------------------------------------------
  49. const char* cmCustomCommand::GetWorkingDirectory() const
  50. {
  51. if(m_WorkingDirectory.size() == 0)
  52. {
  53. return 0;
  54. }
  55. return m_WorkingDirectory.c_str();
  56. }
  57. //----------------------------------------------------------------------------
  58. const std::vector<std::string>& cmCustomCommand::GetDepends() const
  59. {
  60. return m_Depends;
  61. }
  62. //----------------------------------------------------------------------------
  63. const cmCustomCommandLines& cmCustomCommand::GetCommandLines() const
  64. {
  65. return m_CommandLines;
  66. }
  67. //----------------------------------------------------------------------------
  68. const char* cmCustomCommand::GetComment() const
  69. {
  70. return m_Comment.c_str();
  71. }