diff options
author | Brad King <brad.king@kitware.com> | 2008-01-24 12:37:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-24 12:37:15 (GMT) |
commit | 3a462fa6739563cb059299d6956b41f6a828612d (patch) | |
tree | 7df0673040688801f06a8ca1e6da38b7f7e3ebe3 /Source/cmFindLibraryCommand.cxx | |
parent | 7213408287971b395bee21f9aeb59d1e393dc6a9 (diff) | |
download | CMake-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.cxx | 20 |
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; } |