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

Testing own FindBoost.cmake

parent 66bd8f4f
No related branches found
No related tags found
No related merge requests found
......@@ -45,16 +45,28 @@ find_path(
$ENV{BOOST_INCLUDEDIR}
${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost
PATHS
/usr/include
/home/boost
PATH_SUFFIXES
boost
include
)
# Add path without "boost" include sub-directory to include path,
# as Boost headers are supposed to be included like
# #include<boost/...> according to the documentation
set(TMP "")
if(WIN32)
string(REPLACE "\\boost\\boost" "\\boost" TMP ${Boost_INCLUDE_DIRS})
list(APPEND Boost_INCLUDE_DIRS ${TMP})
else()
string(REPLACE "/boost/boost" "/boost" TMP ${Boost_INCLUDE_DIRS})
list(APPEND Boost_INCLUDE_DIRS ${TMP})
endif()
message("Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
if(NOT Boost_INCLUDE_DIRS)
message(FATAL_ERROR "Boost include directory was not found! Please, set variable BOOST_INCLUDEDIR to the correct path.")
endif()
......@@ -95,17 +107,23 @@ find_path(
${BOOST_LIBRARYDIR}
$ENV{BOOST_LIBRARYDIR}
${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost
${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost/stage
${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost/stage/lib
PATHS
/usr/lib/boost
/usr/lib/x86_64-linux-gnu
PATH_SUFFIXES
stage/lib
lib
)
# Construct list of libraries' names and make them
if(NOT Boost_LIBRARY_DIRS)
message(FATAL_ERROR "Boost library directory was not found! Please, set variable BOOST_LIBRARYDIR to the correct path.")
endif()
# Construct list of libraries' names and make them
# targets, so they may be linked
set(Boost_LIBRARIES "")
foreach(LIBNAME ${REQUESTED_BOOST_LIBS})
......
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