FindBoost: search default path if Boost_FIND_VERSION_EXACT

Search paths for boost versions should be build using _boost_TEST_VERSIONS
instead of _Boost_KNOWN_VERSIONS because if Boost_FIND_VERSION_EXACT
is used _Boost_KNOWN_VERSIONS is empty and boost isn't found even in its
default installation path.

Fixes: #17986
This commit is contained in:
Hannes Franke 2018-10-29 16:20:40 +01:00
parent d697f4eb48
commit 9855a80fd4

View File

@ -1258,7 +1258,7 @@ if(NOT Boost_INCLUDE_DIR)
list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
else()
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
foreach(ver ${_Boost_KNOWN_VERSIONS})
foreach(ver ${_boost_TEST_VERSIONS})
string(REPLACE "." "_" ver "${ver}")
list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS "C:/local/boost_${ver}")
endforeach()
@ -1569,7 +1569,7 @@ foreach(c DEBUG RELEASE)
if( Boost_NO_SYSTEM_PATHS )
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
else()
foreach(ver ${_Boost_KNOWN_VERSIONS})
foreach(ver ${_boost_TEST_VERSIONS})
string(REPLACE "." "_" ver "${ver}")
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/local/boost_${ver}")
endforeach()