cmInstallGenerator.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmInstallGenerator_h
  11. #define cmInstallGenerator_h
  12. #include "cmScriptGenerator.h"
  13. class cmLocalGenerator;
  14. /** \class cmInstallGenerator
  15. * \brief Support class for generating install scripts.
  16. *
  17. */
  18. class cmInstallGenerator: public cmScriptGenerator
  19. {
  20. public:
  21. cmInstallGenerator(const char* destination,
  22. std::vector<std::string> const& configurations,
  23. const char* component);
  24. virtual ~cmInstallGenerator();
  25. void AddInstallRule(
  26. std::ostream& os, int type,
  27. std::vector<std::string> const& files,
  28. bool optional = false,
  29. const char* permissions_file = 0,
  30. const char* permissions_dir = 0,
  31. const char* rename = 0,
  32. const char* literal_args = 0,
  33. Indent const& indent = Indent()
  34. );
  35. const char* GetDestination() const
  36. { return this->Destination.c_str(); }
  37. /** Get the install destination as it should appear in the
  38. installation script. */
  39. std::string GetInstallDestination() const;
  40. /** Test if this generator installs something for a given configuration. */
  41. bool InstallsForConfig(const char*);
  42. protected:
  43. virtual void GenerateScript(std::ostream& os);
  44. std::string CreateComponentTest(const char* component);
  45. // Information shared by most generator types.
  46. std::string Destination;
  47. std::string Component;
  48. };
  49. #endif