MCPcopy Index your code
hub / github.com/Kitware/CMake / GetLibraryNames

Method GetLibraryNames

Source/cmGeneratorTarget.cxx:3614–3721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3612}
3613
3614cmGeneratorTarget::Names cmGeneratorTarget::GetLibraryNames(
3615 std::string const& config) const
3616{
3617 cmGeneratorTarget::Names targetNames;
3618
3619 // This should not be called for imported targets.
3620 // TODO: Split cmTarget into a class hierarchy to get compile-time
3621 // enforcement of the limited imported target API.
3622 if (this->IsImported()) {
3623 std::string msg =
3624 cmStrCat("GetLibraryNames called on imported target: ", this->GetName());
3625 this->LocalGenerator->IssueMessage(MessageType::INTERNAL_ERROR, msg);
3626 }
3627
3628 // Check for library version properties.
3629 cmValue version = this->GetProperty("VERSION");
3630 cmValue soversion = this->GetProperty("SOVERSION");
3631 if (!this->HasSOName(config) ||
3632 this->Makefile->IsOn("CMAKE_PLATFORM_NO_VERSIONED_SONAME") ||
3633 this->IsFrameworkOnApple()) {
3634 // Versioning is supported only for shared libraries and modules,
3635 // and then only when the platform supports an soname flag.
3636 version = nullptr;
3637 soversion = nullptr;
3638 }
3639 if (version && !soversion) {
3640 // The soversion must be set if the library version is set. Use
3641 // the library version as the soversion.
3642 soversion = version;
3643 }
3644 if (!version && soversion) {
3645 // Use the soversion as the library version.
3646 version = soversion;
3647 }
3648
3649 // Get the components of the library name.
3650 NameComponents const& components = this->GetFullNameInternalComponents(
3651 config, cmStateEnums::RuntimeBinaryArtifact);
3652
3653 // The library name.
3654 targetNames.Base = components.base;
3655 targetNames.Output =
3656 cmStrCat(components.prefix, targetNames.Base, components.suffix);
3657
3658 if (this->IsFrameworkOnApple()) {
3659 targetNames.Real = components.prefix;
3660 if (!this->Makefile->PlatformIsAppleEmbedded()) {
3661 targetNames.Real +=
3662 cmStrCat("Versions/", this->GetFrameworkVersion(), '/');
3663 }
3664 targetNames.Real += cmStrCat(targetNames.Base, components.suffix);
3665 targetNames.SharedObject = targetNames.Real;
3666 } else if (this->IsArchivedAIXSharedLibrary()) {
3667 targetNames.SharedObject =
3668 cmStrCat(components.prefix, targetNames.Base, ".so");
3669 if (soversion) {
3670 targetNames.SharedObject += ".";
3671 targetNames.SharedObject += *soversion;

Callers 14

GetSONameMethod · 0.95
ComputeTargetManifestMethod · 0.95
NormalGetRealNameMethod · 0.95
GenerateMethod · 0.80
DetectOutputMethod · 0.80
GetFilesMethod · 0.80
GetInstallFilenameMethod · 0.80
OutputBuildToolMethod · 0.80
WriteLibraryRulesMethod · 0.80
WriteLinkStatementMethod · 0.80

Calls 15

IsImportedMethod · 0.95
GetPropertyMethod · 0.95
HasSONameMethod · 0.95
IsFrameworkOnAppleMethod · 0.95
GetFrameworkVersionMethod · 0.95
ComputeVersionedNameMethod · 0.95
GetTypeMethod · 0.95
GetPDBNameMethod · 0.95
cmStrCatFunction · 0.70

Tested by

no test coverage detected