MCPcopy Create free account
hub / github.com/Kitware/CMake / AddInstallRule

Method AddInstallRule

Source/cmInstallGenerator.cxx:43–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void cmInstallGenerator::AddInstallRule(
44 std::ostream& os, std::string const& dest, cmInstallType type,
45 std::vector<std::string> const& files, bool optional /* = false */,
46 char const* permissions_file /* = nullptr */,
47 char const* permissions_dir /* = nullptr */,
48 char const* rename /* = nullptr */, char const* literal_args /* = nullptr */,
49 Indent indent, char const* files_var /* = nullptr */)
50{
51 // Use the FILE command to install the file.
52 std::string stype;
53 switch (type) {
54 case cmInstallType_DIRECTORY:
55 stype = "DIRECTORY";
56 break;
57 case cmInstallType_PROGRAMS:
58 stype = "PROGRAM";
59 break;
60 case cmInstallType_EXECUTABLE:
61 stype = "EXECUTABLE";
62 break;
63 case cmInstallType_STATIC_LIBRARY:
64 stype = "STATIC_LIBRARY";
65 break;
66 case cmInstallType_SHARED_LIBRARY:
67 stype = "SHARED_LIBRARY";
68 break;
69 case cmInstallType_MODULE_LIBRARY:
70 stype = "MODULE";
71 break;
72 case cmInstallType_FILES:
73 stype = "FILE";
74 break;
75 }
76 if (cmSystemTools::FileIsFullPath(dest)) {
77 if (!files.empty()) {
78 os << indent << "list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES\n";
79 os << indent << " \"";
80 bool firstIteration = true;
81 for (std::string const& file : files) {
82 if (!firstIteration) {
83 os << ";";
84 }
85 os << dest << "/";
86 if (rename && *rename) {
87 os << rename;
88 } else {
89 os << cmSystemTools::GetFilenameNameView(file);
90 }
91 firstIteration = false;
92 }
93 os << "\")\n";
94 }
95 if (files_var) {
96 os << indent << "foreach(_cmake_abs_file IN LISTS " << files_var
97 << ")\n";
98 os << indent.Next()
99 << "get_filename_component(_cmake_abs_file_name "
100 "\"${_cmake_abs_file}\" NAME)\n";

Calls 3

emptyMethod · 0.45
NextMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected