| 61 | } |
| 62 | |
| 63 | static 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 | |
| 105 | static void CreateInstallGenerator(cmMakefile& makefile, |
| 106 | std::string const& dest, |
no test coverage detected
searching dependent graphs…