STYLE: fix indentation

ENH: add hack to make new cmake work with older existing cmake build trees

Alex
This commit is contained in:
Alexander Neundorf 2007-05-17 17:21:52 -04:00
parent fc07a8c353
commit b47807fc15

View File

@ -172,19 +172,18 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
// Fix the install_name settings in installed binaries. // Fix the install_name settings in installed binaries.
if((type == cmTarget::SHARED_LIBRARY || if((type == cmTarget::SHARED_LIBRARY ||
type == cmTarget::MODULE_LIBRARY || type == cmTarget::MODULE_LIBRARY ||
type == cmTarget::EXECUTABLE) && type == cmTarget::EXECUTABLE))
this->Target->GetMakefile()->IsSet("CMAKE_INSTALL_NAME_TOOL"))
{ {
this->AddInstallNamePatchRule(os, destination.c_str()); this->AddInstallNamePatchRule(os, destination.c_str());
} }
std::string destinationFilename = destination; std::string destinationFilename = destination;
destinationFilename += "/"; destinationFilename += "/";
destinationFilename += cmSystemTools::GetFilenameName(fromFile); destinationFilename += cmSystemTools::GetFilenameName(fromFile);
this->AddRanlibRule(os, type, destinationFilename); this->AddRanlibRule(os, type, destinationFilename);
this->AddStripRule(os, destinationFilename); this->AddStripRule(os, destinationFilename);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -347,6 +346,22 @@ void cmInstallTargetGenerator
::AddInstallNamePatchRule(std::ostream& os, ::AddInstallNamePatchRule(std::ostream& os,
const char* destination) const char* destination)
{ {
std::string installNameTool = this->Target->GetMakefile()->GetDefinition(
"CMAKE_INSTALL_NAME_TOOL");
// hack: if a new cmake runs on an old build tree, CMAKE_INSTALL_NAME_TOOL
// isn't in the cache, because it was simply hardcoded. To make this work
// adjust it here.
if((this->Target->GetMakefile()->IsOn("APPLE")) && (!installNameTool.size()))
{
installNameTool = "install_name_tool";
}
if(!installNameTool.size())
{
return;
}
// Build a map of build-tree install_name to install-tree install_name for // Build a map of build-tree install_name to install-tree install_name for
// shared libraries linked to this target. // shared libraries linked to this target.
std::map<cmStdString, cmStdString> install_name_remap; std::map<cmStdString, cmStdString> install_name_remap;
@ -425,8 +440,7 @@ void cmInstallTargetGenerator
component_test += this->Component; component_test += this->Component;
component_test += ")$\""; component_test += ")$\"";
os << "IF(" << component_test << ")\n"; os << "IF(" << component_test << ")\n";
os << " EXECUTE_PROCESS(COMMAND \""; os << " EXECUTE_PROCESS(COMMAND \"" << installNameTool;
os <<this->Target->GetMakefile()->GetDefinition("CMAKE_INSTALL_NAME_TOOL");
os << "\""; os << "\"";
if(!new_id.empty()) if(!new_id.empty())
{ {