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