Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Source / cmInstallFilesGenerator.cxx
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 #include "cmInstallFilesGenerator.h"
13
14 //----------------------------------------------------------------------------
15 cmInstallFilesGenerator
16 ::cmInstallFilesGenerator(std::vector<std::string> const& files,
17                           const char* dest, bool programs,
18                           const char* file_permissions,
19                           std::vector<std::string> const& configurations,
20                           const char* component,
21                           const char* rename,
22                           bool optional):
23   cmInstallGenerator(dest, configurations, component),
24   Files(files), Programs(programs),
25   FilePermissions(file_permissions),
26   Rename(rename), Optional(optional)
27 {
28 }
29
30 //----------------------------------------------------------------------------
31 cmInstallFilesGenerator
32 ::~cmInstallFilesGenerator()
33 {
34 }
35
36 //----------------------------------------------------------------------------
37 void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os,
38                                                     Indent const& indent)
39 {
40   // Write code to install the files.
41   const char* no_dir_permissions = 0;
42   this->AddInstallRule(os,
43                        (this->Programs
44                         ? cmInstallType_PROGRAMS
45                         : cmInstallType_FILES),
46                        this->Files,
47                        this->Optional,
48                        this->FilePermissions.c_str(), no_dir_permissions,
49                        this->Rename.c_str(), 0, indent);
50 }