From b3701f9a5213f2ff5b2bc197e9af5d1f2ff68a9c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 8 Oct 2016 12:21:35 +0200 Subject: cmLocalGenerator: Inline conversion into link computation Make it possible to invoke this functionality independent of cmLocalGenerator. --- Source/cmLocalGenerator.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; } /** -- cgit v0.12