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