summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
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;
}
/**