diff --git a/FindBoost.cmake b/FindBoost.cmake index 61fc0d8b7589ad483e531296107cf011591b878d..7fb496c9ab134529895afd93037fcf85821c1b7b 100644 --- a/FindBoost.cmake +++ b/FindBoost.cmake @@ -17,7 +17,7 @@ # * Boost_FOUND - TODO # * Boost_INCLUDE_DIRS - TODO # * Boost_LIBRARY_DIRS - TODO -# * BOOST_LIBRARIES - TODO +# * Boost_LIBRARIES - TODO # Module usage # TODO @@ -95,6 +95,33 @@ find_path( lib ) +# Construct list of libraries' names and make them +# targets, so they may be linked +set(Boost_LIBRARIES ${REQUESTED_BOOST_LIBS}) +foreach(LIBNAME ${Boost_LIBRARIES}) + find_library( + ${LIBNAME} + + NAMES + ${REQUESTED_BOOST_LIBS} + + HINTS + ${BOOST_LIBRARYDIR} + $ENV{BOOST_LIBRARYDIR} + ${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost + + + PATHS + /usr/lib/boost + /usr/lib/x86_64-linux-gnu + + PATH_SUFFIXES + stage/lib + lib + ) +endforeach() + + if(NOT Boost_LIBRARY_DIRS) message(FATAL_ERROR "Boost library directory was not found! Please, set variable BOOST_LIBRARYDIR to the correct path.") endif() @@ -112,12 +139,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS( Boost_LIBRARY_DIRS ) -# Construct list of absolute paths to the requested Boost libraries -set(BOOST_LIBRARIES "") -foreach(LIBRARY ${REQUESTED_BOOST_LIBS}) - list(APPEND BOOST_LIBRARIES "${Boost_LIBRARY_DIRS}/${LIBRARY}") -endforeach() - message("Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}") message("Boost_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}") -message("BOOST_LIBRARIES: ${BOOST_LIBRARIES}") +message("Boost_LIBRARIES: ${Boost_LIBRARIES}")