| 25 | std::vector<std::string> const& args); |
| 26 | |
| 27 | bool cmInstallFilesCommand(std::vector<std::string> const& args, |
| 28 | cmExecutionStatus& status) |
| 29 | { |
| 30 | if (args.size() < 2) { |
| 31 | status.SetError("called with incorrect number of arguments"); |
| 32 | return false; |
| 33 | } |
| 34 | |
| 35 | cmMakefile& mf = status.GetMakefile(); |
| 36 | |
| 37 | // Enable the install target. |
| 38 | mf.GetGlobalGenerator()->EnableInstallTarget(); |
| 39 | |
| 40 | std::string const& dest = args[0]; |
| 41 | |
| 42 | if ((args.size() > 1) && (args[1] == "FILES")) { |
| 43 | std::vector<std::string> files; |
| 44 | for (std::string const& arg : cmMakeRange(args).advance(2)) { |
| 45 | // Find the source location for each file listed. |
| 46 | files.push_back(FindInstallSource(mf, arg.c_str())); |
| 47 | } |
| 48 | CreateInstallGenerator(mf, dest, files); |
| 49 | } else { |
| 50 | std::vector<std::string> finalArgs(args.begin() + 1, args.end()); |
| 51 | mf.AddGeneratorAction( |
| 52 | [dest, finalArgs](cmLocalGenerator& lg, cmListFileBacktrace const&) { |
| 53 | FinalAction(*lg.GetMakefile(), dest, finalArgs); |
| 54 | }); |
| 55 | } |
| 56 | |
| 57 | mf.GetGlobalGenerator()->AddInstallComponent( |
| 58 | mf.GetSafeDefinition("CMAKE_INSTALL_DEFAULT_COMPONENT_NAME")); |
| 59 | |
| 60 | return true; |
| 61 | } |
| 62 | |
| 63 | static void FinalAction(cmMakefile& makefile, std::string const& dest, |
| 64 | std::vector<std::string> const& args) |
nothing calls this directly
no test coverage detected
searching dependent graphs…