cmInstallGenerator.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #ifndef cmInstallGenerator_h
  14. #define cmInstallGenerator_h
  15. #include "cmScriptGenerator.h"
  16. class cmLocalGenerator;
  17. /** \class cmInstallGenerator
  18. * \brief Support class for generating install scripts.
  19. *
  20. */
  21. class cmInstallGenerator: public cmScriptGenerator
  22. {
  23. public:
  24. cmInstallGenerator(const char* destination,
  25. std::vector<std::string> const& configurations,
  26. const char* component);
  27. virtual ~cmInstallGenerator();
  28. void AddInstallRule(
  29. std::ostream& os, int type,
  30. std::vector<std::string> const& files,
  31. bool optional = false,
  32. const char* properties = 0,
  33. const char* permissions_file = 0,
  34. const char* permissions_dir = 0,
  35. const char* rename = 0,
  36. const char* literal_args = 0,
  37. Indent const& indent = Indent()
  38. );
  39. const char* GetDestination() const
  40. { return this->Destination.c_str(); }
  41. /** Get the install destination as it should appear in the
  42. installation script. */
  43. std::string GetInstallDestination() const;
  44. /** Test if this generator installs something for a given configuration. */
  45. bool InstallsForConfig(const char*);
  46. protected:
  47. virtual void GenerateScript(std::ostream& os);
  48. std::string CreateComponentTest(const char* component);
  49. // Information shared by most generator types.
  50. std::string Destination;
  51. std::string Component;
  52. };
  53. #endif