| 3612 | } |
| 3613 | |
| 3614 | cmGeneratorTarget::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; |
no test coverage detected