cmInstallFilesGenerator.cxx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "cmInstallFilesGenerator.h"
  14. #include "cmTarget.h"
  15. //----------------------------------------------------------------------------
  16. cmInstallFilesGenerator
  17. ::cmInstallFilesGenerator(std::vector<std::string> const& files,
  18. const char* dest, bool programs,
  19. const char* permissions,
  20. const char* component,
  21. const char* rename):
  22. Files(files), Destination(dest), Programs(programs),
  23. Permissions(permissions), Component(component), Rename(rename)
  24. {
  25. }
  26. //----------------------------------------------------------------------------
  27. cmInstallFilesGenerator
  28. ::~cmInstallFilesGenerator()
  29. {
  30. }
  31. //----------------------------------------------------------------------------
  32. void cmInstallFilesGenerator::GenerateScript(std::ostream& os)
  33. {
  34. // Write code to install the files.
  35. for(std::vector<std::string>::const_iterator fi = this->Files.begin();
  36. fi != this->Files.end(); ++fi)
  37. {
  38. bool not_optional = false;
  39. const char* no_properties = 0;
  40. this->AddInstallRule(os, this->Destination.c_str(),
  41. (this->Programs
  42. ? cmTarget::INSTALL_PROGRAMS
  43. : cmTarget::INSTALL_FILES), fi->c_str(),
  44. not_optional, no_properties,
  45. this->Permissions.c_str(),
  46. this->Component.c_str(),
  47. this->Rename.c_str());
  48. }
  49. }