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

Function cmInstallFilesCommand

Source/cmInstallFilesCommand.cxx:27–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 std::vector<std::string> const& args);
26
27bool 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
63static void FinalAction(cmMakefile& makefile, std::string const& dest,
64 std::vector<std::string> const& args)

Callers

nothing calls this directly

Calls 15

cmMakeRangeFunction · 0.85
CreateInstallGeneratorFunction · 0.85
EnableInstallTargetMethod · 0.80
push_backMethod · 0.80
c_strMethod · 0.80
AddInstallComponentMethod · 0.80
FindInstallSourceFunction · 0.70
FinalActionFunction · 0.70
sizeMethod · 0.45
SetErrorMethod · 0.45
GetMakefileMethod · 0.45
GetGlobalGeneratorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…