cmInstallFilesGenerator.cxx 1.9 KB

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