BUG: Use GetExecutableNames instead of GetLibraryNames to compute the installation file name for executable targets.
This commit is contained in:
parent
861e3a7107
commit
7fb8ac8904
|
@ -204,27 +204,40 @@ cmInstallTargetGenerator
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute the name of the library.
|
// Compute the name of the library.
|
||||||
std::string targetName;
|
if(target->GetType() == cmTarget::EXECUTABLE)
|
||||||
std::string targetNameSO;
|
|
||||||
std::string targetNameReal;
|
|
||||||
std::string targetNameImport;
|
|
||||||
std::string targetNamePDB;
|
|
||||||
target->GetLibraryNames(targetName, targetNameSO, targetNameReal,
|
|
||||||
targetNameImport, targetNamePDB, i->c_str());
|
|
||||||
if(this->ImportLibrary)
|
|
||||||
{
|
{
|
||||||
// Use the import library name.
|
std::string targetName;
|
||||||
fname += targetNameImport;
|
std::string targetNameReal;
|
||||||
}
|
std::string targetNamePDB;
|
||||||
else if(useSOName)
|
target->GetExecutableNames(targetName, targetNameReal,
|
||||||
{
|
targetNamePDB, i->c_str());
|
||||||
// Use the soname.
|
// Use the canonical name.
|
||||||
fname += targetNameSO;
|
fname += targetName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Use the canonical name.
|
std::string targetName;
|
||||||
fname += targetName;
|
std::string targetNameSO;
|
||||||
|
std::string targetNameReal;
|
||||||
|
std::string targetNameImport;
|
||||||
|
std::string targetNamePDB;
|
||||||
|
target->GetLibraryNames(targetName, targetNameSO, targetNameReal,
|
||||||
|
targetNameImport, targetNamePDB, i->c_str());
|
||||||
|
if(this->ImportLibrary)
|
||||||
|
{
|
||||||
|
// Use the import library name.
|
||||||
|
fname += targetNameImport;
|
||||||
|
}
|
||||||
|
else if(useSOName)
|
||||||
|
{
|
||||||
|
// Use the soname.
|
||||||
|
fname += targetNameSO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Use the canonical name.
|
||||||
|
fname += targetName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a variable with the target name for this configuration.
|
// Set a variable with the target name for this configuration.
|
||||||
|
@ -242,28 +255,41 @@ std::string cmInstallTargetGenerator::GetScriptReference(cmTarget* target,
|
||||||
if(this->ConfigurationTypes->empty())
|
if(this->ConfigurationTypes->empty())
|
||||||
{
|
{
|
||||||
// Reference the target by its one configuration name.
|
// Reference the target by its one configuration name.
|
||||||
std::string targetName;
|
if(target->GetType() == cmTarget::EXECUTABLE)
|
||||||
std::string targetNameSO;
|
|
||||||
std::string targetNameReal;
|
|
||||||
std::string targetNameImport;
|
|
||||||
std::string targetNamePDB;
|
|
||||||
target->GetLibraryNames(targetName, targetNameSO, targetNameReal,
|
|
||||||
targetNameImport, targetNamePDB,
|
|
||||||
this->ConfigurationName);
|
|
||||||
if(this->ImportLibrary)
|
|
||||||
{
|
{
|
||||||
// Use the import library name.
|
std::string targetName;
|
||||||
return targetNameImport;
|
std::string targetNameReal;
|
||||||
}
|
std::string targetNamePDB;
|
||||||
else if(useSOName)
|
target->GetExecutableNames(targetName, targetNameReal,
|
||||||
{
|
targetNamePDB, this->ConfigurationName);
|
||||||
// Use the soname.
|
// Use the canonical name.
|
||||||
return targetNameSO;
|
return targetName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Use the canonical name.
|
std::string targetName;
|
||||||
return targetName;
|
std::string targetNameSO;
|
||||||
|
std::string targetNameReal;
|
||||||
|
std::string targetNameImport;
|
||||||
|
std::string targetNamePDB;
|
||||||
|
target->GetLibraryNames(targetName, targetNameSO, targetNameReal,
|
||||||
|
targetNameImport, targetNamePDB,
|
||||||
|
this->ConfigurationName);
|
||||||
|
if(this->ImportLibrary)
|
||||||
|
{
|
||||||
|
// Use the import library name.
|
||||||
|
return targetNameImport;
|
||||||
|
}
|
||||||
|
else if(useSOName)
|
||||||
|
{
|
||||||
|
// Use the soname.
|
||||||
|
return targetNameSO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Use the canonical name.
|
||||||
|
return targetName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue