Skip to content
Snippets Groups Projects
Commit 0e46ee20 authored by Martin Beseda's avatar Martin Beseda
Browse files

FIX: FindBoost.cmake now sets the variable Boost_LIBRARIES, which contains...

FIX: FindBoost.cmake now sets the variable Boost_LIBRARIES, which contains libraries' names, but it also makes them targets, so the other applications can be linked against them. The variable BOOST_LIBRARIES was removed.
parent fe0ccdde
No related branches found
No related tags found
No related merge requests found
......@@ -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}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment