Fix memory and process leak in ctest_run_script.
[cmake.git] / Source / cmInstallGenerator.h
blob44f881632535c07c11ba24fcb427c7cd71f142e2
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmInstallGenerator.h,v $
5 Language: C++
6 Date: $Date: 2009-04-27 17:20:57 $
7 Version: $Revision: 1.15 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmInstallGenerator_h
18 #define cmInstallGenerator_h
20 #include "cmScriptGenerator.h"
22 class cmLocalGenerator;
24 /** \class cmInstallGenerator
25 * \brief Support class for generating install scripts.
28 class cmInstallGenerator: public cmScriptGenerator
30 public:
31 cmInstallGenerator(const char* destination,
32 std::vector<std::string> const& configurations,
33 const char* component);
34 virtual ~cmInstallGenerator();
36 void AddInstallRule(
37 std::ostream& os, int type,
38 std::vector<std::string> const& files,
39 bool optional = false,
40 const char* permissions_file = 0,
41 const char* permissions_dir = 0,
42 const char* rename = 0,
43 const char* literal_args = 0,
44 Indent const& indent = Indent()
47 const char* GetDestination() const
48 { return this->Destination.c_str(); }
50 /** Get the install destination as it should appear in the
51 installation script. */
52 std::string GetInstallDestination() const;
54 /** Test if this generator installs something for a given configuration. */
55 bool InstallsForConfig(const char*);
57 protected:
58 virtual void GenerateScript(std::ostream& os);
60 std::string CreateComponentTest(const char* component);
62 // Information shared by most generator types.
63 std::string Destination;
64 std::string Component;
67 #endif