| 3721 | } |
| 3722 | |
| 3723 | cmGeneratorTarget::Names cmGeneratorTarget::GetExecutableNames( |
| 3724 | std::string const& config) const |
| 3725 | { |
| 3726 | cmGeneratorTarget::Names targetNames; |
| 3727 | |
| 3728 | // This should not be called for imported targets. |
| 3729 | // TODO: Split cmTarget into a class hierarchy to get compile-time |
| 3730 | // enforcement of the limited imported target API. |
| 3731 | if (this->IsImported()) { |
| 3732 | std::string msg = cmStrCat( |
| 3733 | "GetExecutableNames called on imported target: ", this->GetName()); |
| 3734 | this->LocalGenerator->IssueMessage(MessageType::INTERNAL_ERROR, msg); |
| 3735 | } |
| 3736 | |
| 3737 | // This versioning is supported only for executables and then only |
| 3738 | // when the platform supports symbolic links. |
| 3739 | #if defined(_WIN32) && !defined(__CYGWIN__) |
| 3740 | cmValue version; |
| 3741 | #else |
| 3742 | // Check for executable version properties. |
| 3743 | cmValue version = this->GetProperty("VERSION"); |
| 3744 | if (this->GetType() != cmStateEnums::EXECUTABLE || |
| 3745 | this->Makefile->IsOn("XCODE")) { |
| 3746 | version = nullptr; |
| 3747 | } |
| 3748 | #endif |
| 3749 | |
| 3750 | // Get the components of the executable name. |
| 3751 | NameComponents const& components = this->GetFullNameInternalComponents( |
| 3752 | config, cmStateEnums::RuntimeBinaryArtifact); |
| 3753 | |
| 3754 | // The executable name. |
| 3755 | targetNames.Base = components.base; |
| 3756 | |
| 3757 | if (this->IsArchivedAIXSharedLibrary()) { |
| 3758 | targetNames.Output = components.prefix + targetNames.Base; |
| 3759 | } else { |
| 3760 | targetNames.Output = |
| 3761 | components.prefix + targetNames.Base + components.suffix; |
| 3762 | } |
| 3763 | |
| 3764 | // The executable's real name on disk. |
| 3765 | #if defined(__CYGWIN__) |
| 3766 | targetNames.Real = components.prefix + targetNames.Base; |
| 3767 | #else |
| 3768 | targetNames.Real = targetNames.Output; |
| 3769 | #endif |
| 3770 | if (version) { |
| 3771 | targetNames.Real += "-"; |
| 3772 | targetNames.Real += *version; |
| 3773 | } |
| 3774 | #if defined(__CYGWIN__) |
| 3775 | targetNames.Real += components.suffix; |
| 3776 | #endif |
| 3777 | |
| 3778 | // The import library name. |
| 3779 | targetNames.ImportLibrary = |
| 3780 | this->GetFullNameInternal(config, cmStateEnums::ImportLibraryArtifact); |
no test coverage detected