cmInstallFilesGenerator.cxx 2.3 KB

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