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

Method PackageFiles

Source/CPack/cmCPackAppImageGenerator.cxx:64–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64int cmCPackAppImageGenerator::PackageFiles()
65{
66 cmCPackLogger(cmCPackLog::LOG_OUTPUT,
67 "AppDir: \"" << this->toplevel << "\"" << std::endl);
68
69 // Desktop file must be in the toplevel dir
70 auto const desktopFile = FindDesktopFile();
71 if (!desktopFile) {
72 cmCPackLogger(cmCPackLog::LOG_WARNING,
73 "A desktop file is required to build an AppImage, make sure "
74 "it's listed for install()."
75 << std::endl);
76 return 0;
77 }
78
79 {
80 cmCPackLogger(cmCPackLog::LOG_OUTPUT,
81 "Found Desktop file: \"" << desktopFile.value() << "\""
82 << std::endl);
83 std::string desktopSymLink = this->toplevel + "/" +
84 cmSystemTools::GetFilenameName(desktopFile.value());
85 cmCPackLogger(cmCPackLog::LOG_OUTPUT,
86 "Desktop file destination: \"" << desktopSymLink << "\""
87 << std::endl);
88 auto status = cmSystemTools::CreateSymlink(
89 cmSystemTools::RelativePath(toplevel, *desktopFile), desktopSymLink);
90 if (status.IsSuccess()) {
91 cmCPackLogger(cmCPackLog::LOG_DEBUG,
92 "Desktop symbolic link created successfully."
93 << std::endl);
94 } else {
95 cmCPackLogger(cmCPackLog::LOG_ERROR,
96 "Error creating symbolic link." << status.GetString()
97 << std::endl);
98 return 0;
99 }
100 }
101
102 auto const desktopEntry = ParseDesktopFile(*desktopFile);
103
104 {
105 // Prepare Icon file
106 auto const iconValue = desktopEntry.find("Icon");
107 if (iconValue == desktopEntry.end()) {
108 cmCPackLogger(cmCPackLog::LOG_ERROR,
109 "An Icon key is required to build an AppImage, make sure "
110 "the desktop file has a reference to one."
111 << std::endl);
112 return 0;
113 }
114
115 auto icon = this->GetOption("CPACK_PACKAGE_ICON");
116 if (!icon) {
117 cmCPackLogger(cmCPackLog::LOG_ERROR,
118 "CPACK_PACKAGE_ICON is required to build an AppImage."
119 << std::endl);
120 return 0;
121 }

Callers

nothing calls this directly

Calls 12

GetOutputExtensionMethod · 0.95
SetPermissionsFunction · 0.85
valueMethod · 0.80
c_strMethod · 0.80
emplace_backMethod · 0.80
cmStrCatFunction · 0.50
GetStringMethod · 0.45
findMethod · 0.45
endMethod · 0.45
GetOptionMethod · 0.45
emptyMethod · 0.45
frontMethod · 0.45

Tested by

no test coverage detected