summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-08 10:21:35 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-10 18:38:52 (GMT)
commitb3701f9a5213f2ff5b2bc197e9af5d1f2ff68a9c (patch)
tree9d6381c8b950a64756152da2fc0bf7d01361b789 /Source/cmLocalGenerator.cxx
parent06b71ff9fb41369e6dce0c2b9760d2d546d47dec (diff)
downloadCMake-b3701f9a5213f2ff5b2bc197e9af5d1f2ff68a9c.zip
CMake-b3701f9a5213f2ff5b2bc197e9af5d1f2ff68a9c.tar.gz
CMake-b3701f9a5213f2ff5b2bc197e9af5d1f2ff68a9c.tar.bz2
cmLocalGenerator: Inline conversion into link computation
Make it possible to invoke this functionality independent of cmLocalGenerator.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 025b82a..f1b7c6a 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1407,7 +1407,14 @@ std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib)
#endif
// Normal behavior.
- return this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), lib);
+ std::string relLib = lib;
+ cmState::Directory stateDir = this->GetStateSnapshot().GetDirectory();
+ if (cmOutputConverter::ContainedInDirectory(
+ stateDir.GetCurrentBinary(), lib, stateDir)) {
+ relLib = cmOutputConverter::ForceToRelativePath(
+ stateDir.GetCurrentBinary(), lib);
+ }
+ return relLib;
}
/**