summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2013-04-27 04:04:44 (GMT)
committerBrad King <brad.king@kitware.com>2013-06-03 13:42:05 (GMT)
commit94e7fef2268ba9d31bd31834f05f6d0c2ffe5a18 (patch)
tree4676709c61c7f1d8352f5e9729bb875cb2816e34 /Source/cmSystemTools.cxx
parentcbe3f2072bdd181660bc4f9174a73febd3ed5230 (diff)
downloadCMake-94e7fef2268ba9d31bd31834f05f6d0c2ffe5a18.zip
CMake-94e7fef2268ba9d31bd31834f05f6d0c2ffe5a18.tar.gz
CMake-94e7fef2268ba9d31bd31834f05f6d0c2ffe5a18.tar.bz2
OS X: Add RPATH support for Mac.
RPATH support is activated on targets that have the MACOSX_RPATH property turned on. For install time, it is also useful to set INSTALL_RPATH to help find dependent libraries with an @rpath in their install name. Also adding detection of rpath conflicts when using frameworks.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 67f3023..803d0da 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2413,6 +2413,27 @@ bool cmSystemTools::GuessLibrarySOName(std::string const& fullPath,
}
//----------------------------------------------------------------------------
+bool cmSystemTools::GuessLibraryInstallName(std::string const& fullPath,
+ std::string& soname)
+{
+ std::vector<cmStdString> cmds;
+ cmds.push_back("otool");
+ cmds.push_back("-D");
+ cmds.push_back(fullPath.c_str());
+
+ std::string output;
+ RunSingleCommand(cmds, &output, 0, 0, OUTPUT_NONE);
+
+ std::vector<std::string> strs = cmSystemTools::tokenize(output, "\n");
+ if(strs.size() == 2)
+ {
+ soname = strs[1];
+ return true;
+ }
+ return false;
+}
+
+//----------------------------------------------------------------------------
#if defined(CMAKE_USE_ELF_PARSER)
std::string::size_type cmSystemToolsFindRPath(std::string const& have,
std::string const& want)