cmCustomCommand.cxx 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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->EscapeOldStyle = true;
  18. this->EscapeAllowMakeVars = false;
  19. this->Used = false;
  20. }
  21. //----------------------------------------------------------------------------
  22. cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
  23. Outputs(r.Outputs),
  24. Depends(r.Depends),
  25. CommandLines(r.CommandLines),
  26. Comment(r.Comment),
  27. WorkingDirectory(r.WorkingDirectory)
  28. {
  29. this->EscapeOldStyle = true;
  30. this->EscapeAllowMakeVars = false;
  31. this->Used = false;
  32. }
  33. //----------------------------------------------------------------------------
  34. cmCustomCommand::cmCustomCommand(const std::vector<std::string>& outputs,
  35. const std::vector<std::string>& depends,
  36. const cmCustomCommandLines& commandLines,
  37. const char* comment,
  38. const char* workingDirectory):
  39. Outputs(outputs),
  40. Depends(depends),
  41. CommandLines(commandLines),
  42. Comment(comment?comment:""),
  43. WorkingDirectory(workingDirectory?workingDirectory:"")
  44. {
  45. this->EscapeOldStyle = true;
  46. this->EscapeAllowMakeVars = false;
  47. this->Used = false;
  48. }
  49. //----------------------------------------------------------------------------
  50. const std::vector<std::string>& cmCustomCommand::GetOutputs() const
  51. {
  52. return this->Outputs;
  53. }
  54. //----------------------------------------------------------------------------
  55. const char* cmCustomCommand::GetWorkingDirectory() const
  56. {
  57. if(this->WorkingDirectory.size() == 0)
  58. {
  59. return 0;
  60. }
  61. return this->WorkingDirectory.c_str();
  62. }
  63. //----------------------------------------------------------------------------
  64. const std::vector<std::string>& cmCustomCommand::GetDepends() const
  65. {
  66. return this->Depends;
  67. }
  68. //----------------------------------------------------------------------------
  69. const cmCustomCommandLines& cmCustomCommand::GetCommandLines() const
  70. {
  71. return this->CommandLines;
  72. }
  73. //----------------------------------------------------------------------------
  74. const char* cmCustomCommand::GetComment() const
  75. {
  76. return this->Comment.c_str();
  77. }
  78. //----------------------------------------------------------------------------
  79. bool cmCustomCommand::GetEscapeOldStyle() const
  80. {
  81. return this->EscapeOldStyle;
  82. }
  83. //----------------------------------------------------------------------------
  84. void cmCustomCommand::SetEscapeOldStyle(bool b)
  85. {
  86. this->EscapeOldStyle = b;
  87. }
  88. //----------------------------------------------------------------------------
  89. bool cmCustomCommand::GetEscapeAllowMakeVars() const
  90. {
  91. return this->EscapeAllowMakeVars;
  92. }
  93. //----------------------------------------------------------------------------
  94. void cmCustomCommand::SetEscapeAllowMakeVars(bool b)
  95. {
  96. this->EscapeAllowMakeVars = b;
  97. }