summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2013-07-27 04:17:30 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2013-07-27 04:38:57 (GMT)
commit84698abb514b665c5db5111ecf247d44b9979844 (patch)
tree07383350bc60df70b2e1c8b2b0c1d518a4229a9c /Source/cmSystemTools.cxx
parent46558d290be1760828714545f41afae17b0c71c9 (diff)
downloadCMake-84698abb514b665c5db5111ecf247d44b9979844.zip
CMake-84698abb514b665c5db5111ecf247d44b9979844.tar.gz
CMake-84698abb514b665c5db5111ecf247d44b9979844.tar.bz2
OS X: If necessary, use xcrun to help find otool used to query install names.
This fixes querying for @rpath install names when using Xcode without the command line tools installed.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index c52c266..37344dc 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2464,7 +2464,15 @@ bool cmSystemTools::GuessLibraryInstallName(std::string const& fullPath,
cmds.push_back(fullPath.c_str());
std::string output;
- RunSingleCommand(cmds, &output, 0, 0, OUTPUT_NONE);
+ if(!RunSingleCommand(cmds, &output, 0, 0, OUTPUT_NONE))
+ {
+ cmds.insert(cmds.begin(), "-r");
+ cmds.insert(cmds.begin(), "xcrun");
+ if(!RunSingleCommand(cmds, &output, 0, 0, OUTPUT_NONE))
+ {
+ return false;
+ }
+ }
std::vector<std::string> strs = cmSystemTools::tokenize(output, "\n");
// otool returns extra lines reporting multiple install names