BUG: Do not collapse the INSTALL_NAME_DIR setting because users may intend to have .. in the path. This makes the makefile generator consistent with the already working Xcode implementation of this feature. Also added a test for @executable_path/.. style settings for this property.
This commit is contained in:
parent
c0326d0d54
commit
b20fd1af11
|
@ -548,19 +548,9 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
||||||
std::string install_name_dir;
|
std::string install_name_dir;
|
||||||
if(this->Target->GetType() == cmTarget::SHARED_LIBRARY)
|
if(this->Target->GetType() == cmTarget::SHARED_LIBRARY)
|
||||||
{
|
{
|
||||||
// Select whether to generate an install_name directory for the
|
// Get the install_name directory for the build tree.
|
||||||
// install tree or the build tree.
|
|
||||||
const char* config = this->LocalGenerator->ConfigurationName.c_str();
|
const char* config = this->LocalGenerator->ConfigurationName.c_str();
|
||||||
if(this->Target->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"))
|
install_name_dir = this->Target->GetInstallNameDirForBuildTree(config);
|
||||||
{
|
|
||||||
install_name_dir =
|
|
||||||
this->Target->GetInstallNameDirForInstallTree(config);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
install_name_dir =
|
|
||||||
this->Target->GetInstallNameDirForBuildTree(config);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the rule variable replacement value.
|
// Set the rule variable replacement value.
|
||||||
if(install_name_dir.empty())
|
if(install_name_dir.empty())
|
||||||
|
@ -572,13 +562,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
||||||
// Convert to a path for the native build tool.
|
// Convert to a path for the native build tool.
|
||||||
install_name_dir =
|
install_name_dir =
|
||||||
this->LocalGenerator->Convert(install_name_dir.c_str(),
|
this->LocalGenerator->Convert(install_name_dir.c_str(),
|
||||||
cmLocalGenerator::FULL,
|
cmLocalGenerator::NONE,
|
||||||
cmLocalGenerator::SHELL, false);
|
cmLocalGenerator::SHELL, false);
|
||||||
|
|
||||||
// The Convert method seems to strip trailing slashes, which should
|
|
||||||
// probably be fixed. Since the only platform supporting install_name
|
|
||||||
// right now uses forward slashes just add one.
|
|
||||||
install_name_dir += "/";
|
|
||||||
vars.TargetInstallNameDir = install_name_dir.c_str();
|
vars.TargetInstallNameDir = install_name_dir.c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,7 +205,8 @@ ELSE(STAGE2)
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
|
${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
|
||||||
SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
|
SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
|
${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
|
||||||
SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3)
|
SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3
|
||||||
|
INSTALL_NAME_DIR @executable_path/../lib)
|
||||||
ENDIF(STAGE2)
|
ENDIF(STAGE2)
|
||||||
|
|
||||||
IF(CMAKE_CONFIGURATION_TYPES)
|
IF(CMAKE_CONFIGURATION_TYPES)
|
||||||
|
|
|
@ -205,7 +205,8 @@ ELSE(STAGE2)
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
|
${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake)
|
||||||
SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
|
SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
|
${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake)
|
||||||
SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3)
|
SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3
|
||||||
|
INSTALL_NAME_DIR @executable_path/../lib)
|
||||||
ENDIF(STAGE2)
|
ENDIF(STAGE2)
|
||||||
|
|
||||||
IF(CMAKE_CONFIGURATION_TYPES)
|
IF(CMAKE_CONFIGURATION_TYPES)
|
||||||
|
|
Loading…
Reference in New Issue