FindBoost: fix find_library call when using "re-rooting"

When using CMAKE_FIND_ROOT_PATH, FindBoost is able to find the first
component and cache the full path of the directory in Boost_LIBRARY_DIR
so that all components are looked for in same directory. The issue was
that, when looking for the other components, Boost_LIBRARY_DIR was
re-rooted against CMAKE_FIND_ROOT_PATH even though it was already a path
on the host. This change fixes this by disabling the re-rooting in the
find_library call when using Boost_LIBRARY_DIR as a hint.

See http://www.cmake.org/pipermail/cmake-developers/2014-October/011670.html
This commit is contained in:
Guillaume Papin 2014-10-23 09:10:54 +02:00 committed by Chuck Atkins
parent 97eb511672
commit 43b8bfb213
1 changed files with 2 additions and 2 deletions

View File

@ -321,7 +321,7 @@ macro(_Boost_FIND_LIBRARY var)
# If Boost_LIBRARY_DIR is known then search only there.
if(Boost_LIBRARY_DIR)
set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH)
set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
endif()
endmacro()
@ -855,7 +855,7 @@ if(_Boost_CHANGE_LIBDIR AND NOT _Boost_LIBRARY_DIR_CHANGED)
endif()
if(Boost_LIBRARY_DIR)
set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH)
set(_boost_LIBRARY_SEARCH_DIRS ${Boost_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
else()
set(_boost_LIBRARY_SEARCH_DIRS "")
if(BOOST_LIBRARYDIR)