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

Method GetFiles

Source/cmInstallTargetGenerator.cxx:224–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224cmInstallTargetGenerator::Files cmInstallTargetGenerator::GetFiles(
225 std::string const& config) const
226{
227 Files files;
228
229 cmStateEnums::TargetType targetType = this->Target->GetType();
230 switch (targetType) {
231 case cmStateEnums::EXECUTABLE:
232 files.Type = cmInstallType_EXECUTABLE;
233 break;
234 case cmStateEnums::STATIC_LIBRARY:
235 files.Type = cmInstallType_STATIC_LIBRARY;
236 break;
237 case cmStateEnums::SHARED_LIBRARY:
238 files.Type = cmInstallType_SHARED_LIBRARY;
239 break;
240 case cmStateEnums::MODULE_LIBRARY:
241 files.Type = cmInstallType_MODULE_LIBRARY;
242 break;
243 case cmStateEnums::INTERFACE_LIBRARY:
244 // Not reachable. We never create a cmInstallTargetGenerator for
245 // an INTERFACE_LIBRARY.
246 assert(false &&
247 "INTERFACE_LIBRARY targets have no installable outputs.");
248 break;
249
250 case cmStateEnums::OBJECT_LIBRARY: {
251 // Compute all the object files inside this target
252 std::vector<std::pair<cmObjectLocation, cmObjectLocation>> objects;
253 auto storeObjectLocations = [&objects](cmObjectLocation const& build,
254 cmObjectLocation const& install) {
255 objects.emplace_back(build, install);
256 };
257 this->Target->GetTargetObjectLocations(config, storeObjectLocations);
258
259 files.Type = cmInstallType_FILES;
260 files.NoTweak = true;
261 files.Rename = true;
262 files.FromDir = this->Target->GetObjectDirectory(config);
263 if (!this->Target->GetPropertyAsBool(
264 "INSTALL_OBJECT_ONLY_USE_DESTINATION")) {
265 files.ToDir = computeInstallObjectDir(this->Target, config);
266 }
267 for (auto const& obj : objects) {
268 files.From.emplace_back(obj.first.GetPath());
269 files.To.emplace_back(obj.second.GetPath());
270 }
271 return files;
272 }
273
274 case cmStateEnums::UTILITY:
275 case cmStateEnums::GLOBAL_TARGET:
276 case cmStateEnums::UNKNOWN_LIBRARY:
277 this->Target->GetLocalGenerator()->IssueMessage(
278 MessageType::INTERNAL_ERROR,
279 "cmInstallTargetGenerator created with non-installable target.");
280 return files;
281 }

Callers 1

Calls 15

computeInstallObjectDirFunction · 0.85
moveFunction · 0.85
computeFilesToInstallFunction · 0.85
emplace_backMethod · 0.80
GetObjectDirectoryMethod · 0.80
GetPathMethod · 0.80
GetExecutableNamesMethod · 0.80
GetImplibGNUtoMSMethod · 0.80
GetLibraryNamesMethod · 0.80

Tested by

no test coverage detected