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

Function FinalAction

Source/cmInstallFilesCommand.cxx:63–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63static void FinalAction(cmMakefile& makefile, std::string const& dest,
64 std::vector<std::string> const& args)
65{
66 std::string testf;
67 std::string const& ext = args[0];
68 std::vector<std::string> installFiles;
69
70 // two different options
71 if (args.size() > 1) {
72 // now put the files into the list
73 auto s = args.begin();
74 ++s;
75 // for each argument, get the files
76 for (; s != args.end(); ++s) {
77 // replace any variables
78 std::string const& temps = *s;
79 if (!cmSystemTools::GetFilenamePath(temps).empty()) {
80 testf = cmSystemTools::GetFilenamePath(temps) + "/" +
81 cmSystemTools::GetFilenameWithoutLastExtension(temps) + ext;
82 } else {
83 testf = cmSystemTools::GetFilenameWithoutLastExtension(temps) + ext;
84 }
85
86 // add to the result
87 installFiles.push_back(FindInstallSource(makefile, testf.c_str()));
88 }
89 } else // reg exp list
90 {
91 std::vector<std::string> files;
92 std::string const& regex = args[0];
93 cmSystemTools::Glob(makefile.GetCurrentSourceDirectory(), regex, files);
94
95 auto s = files.begin();
96 // for each argument, get the files
97 for (; s != files.end(); ++s) {
98 installFiles.push_back(FindInstallSource(makefile, s->c_str()));
99 }
100 }
101
102 CreateInstallGenerator(makefile, dest, installFiles);
103}
104
105static void CreateInstallGenerator(cmMakefile& makefile,
106 std::string const& dest,

Callers 1

cmInstallFilesCommandFunction · 0.70

Calls 8

CreateInstallGeneratorFunction · 0.85
push_backMethod · 0.80
c_strMethod · 0.80
FindInstallSourceFunction · 0.70
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…