summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2013-05-20 22:57:58 (GMT)
committerBrad King <brad.king@kitware.com>2013-06-03 13:42:05 (GMT)
commit8576b3f978e65a9c94630226e1da3f03047691a7 (patch)
tree256b6205b49a5518434f87484bf37811cfb3d27f /Source
parent00d71bdd193b645aec10b41866bddb164c0eb093 (diff)
downloadCMake-8576b3f978e65a9c94630226e1da3f03047691a7.zip
CMake-8576b3f978e65a9c94630226e1da3f03047691a7.tar.gz
CMake-8576b3f978e65a9c94630226e1da3f03047691a7.tar.bz2
OS X: Add support for @rpath in export files.
Also expand the IMPORTED_SONAME property for targets to match the install_name.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExportBuildFileGenerator.cxx16
-rw-r--r--Source/cmExportBuildFileGenerator.h2
-rw-r--r--Source/cmExportFileGenerator.cxx6
-rw-r--r--Source/cmExportFileGenerator.h3
-rw-r--r--Source/cmExportInstallFileGenerator.cxx16
-rw-r--r--Source/cmExportInstallFileGenerator.h2
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx15
-rw-r--r--Source/cmExportTryCompileFileGenerator.h2
-rw-r--r--Source/cmTarget.cxx4
9 files changed, 65 insertions, 1 deletions
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index f8a32c2..75a8aba 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -211,3 +211,19 @@ cmExportBuildFileGenerator
<< "consider using the APPEND option with multiple separate calls.";
this->ExportCommand->ErrorMessage = e.str();
}
+
+std::string
+cmExportBuildFileGenerator::InstallNameDir(cmTarget* target,
+ const std::string& config)
+{
+ std::string install_name_dir;
+
+ cmMakefile* mf = target->GetMakefile();
+ if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
+ {
+ install_name_dir =
+ target->GetInstallNameDirForBuildTree(config.c_str());
+ }
+
+ return install_name_dir;
+}
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index 5e1be16..3ffdf8b 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -61,6 +61,8 @@ protected:
cmTarget* target,
ImportPropertyMap& properties);
+ std::string InstallNameDir(cmTarget* target, const std::string& config);
+
std::vector<cmTarget*> const* Exports;
cmExportCommand* ExportCommand;
};
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 27ec56b..c465a68 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -624,8 +624,12 @@ cmExportFileGenerator
std::string value;
if(target->HasSOName(config))
{
+ if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
+ {
+ value = this->InstallNameDir(target, config);
+ }
prop = "IMPORTED_SONAME";
- value = target->GetSOName(config);
+ value += target->GetSOName(config);
}
else
{
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 9f958a2..ed2d93b 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -159,6 +159,9 @@ private:
std::vector<std::string> &missingTargets);
virtual void ReplaceInstallPrefix(std::string &input);
+
+ virtual std::string InstallNameDir(cmTarget* target,
+ const std::string& config) = 0;
};
#endif
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index fff807c..9d1bdaf 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -490,3 +490,19 @@ cmExportInstallFileGenerator
}
cmSystemTools::Error(e.str().c_str());
}
+
+std::string
+cmExportInstallFileGenerator::InstallNameDir(cmTarget* target,
+ const std::string&)
+{
+ std::string install_name_dir;
+
+ cmMakefile* mf = target->GetMakefile();
+ if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
+ {
+ install_name_dir =
+ target->GetInstallNameDirForInstallTree();
+ }
+
+ return install_name_dir;
+}
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index 20dd57a..7c634a4 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -85,6 +85,8 @@ protected:
void ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen);
+ std::string InstallNameDir(cmTarget* target, const std::string& config);
+
cmInstallExportGenerator* IEGen;
std::string ImportPrefix;
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 75f2651..948508b 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -112,3 +112,18 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget* target,
}
}
}
+std::string
+cmExportTryCompileFileGenerator::InstallNameDir(cmTarget* target,
+ const std::string& config)
+{
+ std::string install_name_dir;
+
+ cmMakefile* mf = target->GetMakefile();
+ if(mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
+ {
+ install_name_dir =
+ target->GetInstallNameDirForBuildTree(config.c_str());
+ }
+
+ return install_name_dir;
+}
diff --git a/Source/cmExportTryCompileFileGenerator.h b/Source/cmExportTryCompileFileGenerator.h
index ed393ab..91b4a61 100644
--- a/Source/cmExportTryCompileFileGenerator.h
+++ b/Source/cmExportTryCompileFileGenerator.h
@@ -43,6 +43,8 @@ protected:
ImportPropertyMap& properties,
std::set<cmTarget*> &emitted);
+ std::string InstallNameDir(cmTarget* target,
+ const std::string& config);
private:
std::string FindTargets(const char *prop, cmTarget *tgt,
std::set<cmTarget*> &emitted);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index a4b3938..ea718ae 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -3782,6 +3782,10 @@ std::string cmTarget::GetSOName(const char* config)
else
{
// Use the soname given if any.
+ if(info->SOName.find("@rpath/") == 0)
+ {
+ return info->SOName.substr(6);
+ }
return info->SOName;
}
}