diff options
author | Brad King <brad.king@kitware.com> | 2013-11-22 13:40:50 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-11-22 13:40:50 (GMT) |
commit | 3013a118269a854fb5b7ef078c778099b991dd7d (patch) | |
tree | 35e2f751a805edf944ed0bb79aaa57b64e05c3d3 /Source | |
parent | ed0b342603fff46534dbb956f4a4354f05be2c16 (diff) | |
parent | 7521da2852a2fce16919b2640bcc0fa2f0c55b7d (diff) | |
download | CMake-3013a118269a854fb5b7ef078c778099b991dd7d.zip CMake-3013a118269a854fb5b7ef078c778099b991dd7d.tar.gz CMake-3013a118269a854fb5b7ef078c778099b991dd7d.tar.bz2 |
Merge topic 'cross-compiling-toolchain-variables'
7521da2 Introduce CMAKE_STAGING_PREFIX variable.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 20 | ||||
-rw-r--r-- | Source/cmFindCommon.cxx | 7 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 5 |
3 files changed, 31 insertions, 1 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 3152c2a..0ef3d2e 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1902,6 +1902,10 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, if(use_build_rpath || use_link_rpath) { std::string rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT"); + const char *stagePath + = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX"); + const char *installPrefix + = this->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); cmSystemTools::ConvertToUnixSlashes(rootPath); std::vector<std::string> const& rdirs = this->GetRuntimeSearchPath(); for(std::vector<std::string>::const_iterator ri = rdirs.begin(); @@ -1916,6 +1920,14 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, { d = d.substr(rootPath.size()); } + else if (stagePath && *stagePath && d.find(stagePath) == 0) + { + std::string suffix = d.substr(strlen(stagePath)); + d = installPrefix; + d += "/"; + d += suffix; + cmSystemTools::ConvertToUnixSlashes(d); + } if(emitted.insert(d).second) { runtimeDirs.push_back(d); @@ -1936,6 +1948,14 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, { d = d.substr(rootPath.size()); } + else if (stagePath && *stagePath && d.find(stagePath) == 0) + { + std::string suffix = d.substr(strlen(stagePath)); + d = installPrefix; + d += "/"; + d += suffix; + cmSystemTools::ConvertToUnixSlashes(d); + } if(emitted.insert(d).second) { runtimeDirs.push_back(d); diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 8c42811..e8c8da3 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -165,6 +165,9 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths) cmSystemTools::ConvertToUnixSlashes(*ri); } + const char* stagePrefix = + this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX"); + // Copy the original set of unrooted paths. std::vector<std::string> unrootedPaths = paths; paths.clear(); @@ -179,7 +182,9 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths) // already inside. Skip the unrooted path if it is relative to // a user home directory or is empty. std::string rootedDir; - if(cmSystemTools::IsSubDirectory(ui->c_str(), ri->c_str())) + if(cmSystemTools::IsSubDirectory(ui->c_str(), ri->c_str()) + || (stagePrefix + && cmSystemTools::IsSubDirectory(ui->c_str(), stagePrefix))) { rootedDir = *ui; } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index d2784a9..cf5798f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -370,6 +370,11 @@ void cmLocalGenerator::GenerateInstallRules() prefix = "/usr/local"; } #endif + if (const char *stagingPrefix + = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX")) + { + prefix = stagingPrefix; + } // Compute the set of configurations. std::vector<std::string> configurationTypes; |