summaryrefslogtreecommitdiffstats
path: root/Source/cmFindLibraryCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-24 12:37:15 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-24 12:37:15 (GMT)
commit3a462fa6739563cb059299d6956b41f6a828612d (patch)
tree7df0673040688801f06a8ca1e6da38b7f7e3ebe3 /Source/cmFindLibraryCommand.cxx
parent7213408287971b395bee21f9aeb59d1e393dc6a9 (diff)
downloadCMake-3a462fa6739563cb059299d6956b41f6a828612d.zip
CMake-3a462fa6739563cb059299d6956b41f6a828612d.tar.gz
CMake-3a462fa6739563cb059299d6956b41f6a828612d.tar.bz2
ENH: Apply new implicit link directory find_library policy when loading a cache from an earlier CMake.
Diffstat (limited to 'Source/cmFindLibraryCommand.cxx')
-rw-r--r--Source/cmFindLibraryCommand.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 1f9a9f4..34f476e 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -86,6 +86,26 @@ bool cmFindLibraryCommand
this->VariableDocumentation.c_str(),
cmCacheManager::FILEPATH);
}
+
+ // If the existing value was loaded from a cache written by CMake
+ // 2.4 or below then force the implicit link directory fix on the
+ // value.
+ if(this->Makefile->NeedCacheCompatibility(2, 4))
+ {
+ if(const char* v =
+ this->Makefile->GetDefinition(this->VariableName.c_str()))
+ {
+ std::string nv = this->FixForImplicitLocations(v);
+ if(nv != v)
+ {
+ this->Makefile
+ ->AddCacheDefinition(this->VariableName.c_str(),
+ nv.c_str(),
+ this->VariableDocumentation.c_str(),
+ cmCacheManager::FILEPATH);
+ }
+ }
+ }
return true;
}