diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2013-05-01 12:27:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-06-03 13:42:05 (GMT) |
commit | 00d71bdd193b645aec10b41866bddb164c0eb093 (patch) | |
tree | 055c5bac24555f6628196aa9c6291e61e123ba8c /Source | |
parent | 94e7fef2268ba9d31bd31834f05f6d0c2ffe5a18 (diff) | |
download | CMake-00d71bdd193b645aec10b41866bddb164c0eb093.zip CMake-00d71bdd193b645aec10b41866bddb164c0eb093.tar.gz CMake-00d71bdd193b645aec10b41866bddb164c0eb093.tar.bz2 |
Xcode: Add rpath support in Xcode generator.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 9bbf186..f2bb9d7 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2244,6 +2244,29 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, buildSettings->AddAttribute("INSTALL_PATH", this->CreateString(install_name_dir.c_str())); + // Create the LD_RUNPATH_SEARCH_PATHS + cmComputeLinkInformation* pcli = target.GetLinkInformation(configName); + if(pcli) + { + std::string search_paths; + std::vector<std::string> runtimeDirs; + pcli->GetRPath(runtimeDirs, false); + for(std::vector<std::string>::const_iterator i = runtimeDirs.begin(); + i != runtimeDirs.end(); ++i) + { + if(!search_paths.empty()) + { + search_paths += " "; + } + search_paths += this->XCodeEscapePath((*i).c_str()); + } + if(!search_paths.empty()) + { + buildSettings->AddAttribute("LD_RUNPATH_SEARCH_PATHS", + this->CreateString(search_paths.c_str())); + } + } + buildSettings->AddAttribute("OTHER_LDFLAGS", this->CreateString(extraLinkOptions.c_str())); buildSettings->AddAttribute("OTHER_REZFLAGS", |