diff --git a/FindBoost.cmake b/FindBoost.cmake index d596c8d992ff63b2f5d8e19f1524b593e0ee8953..74015b4c13420454d1bcd0a90ce26880e0ff833c 100644 --- a/FindBoost.cmake +++ b/FindBoost.cmake @@ -28,6 +28,7 @@ if(NOT Boost_FIND_COMPONENTS) endif() # Look for a standard boost header file. +set(Boost_INCLUDE_DIRS "Boost_INCLUDE_DIRS-NOTFOUND") find_path( Boost_INCLUDE_DIRS @@ -41,19 +42,16 @@ find_path( PATHS - /usr/include/boost + /usr/include /home/boost PATH_SUFFIXES boost include - -) +) if(NOT Boost_INCLUDE_DIRS) message(FATAL_ERROR "Boost include directory was not found! Please, set variable BOOST_INCLUDEDIR to the correct path.") -#else() -# include_directories("${Boost_INCLUDE_DIRS}") endif() # Create a list of requested Boost libraries with "system" names @@ -79,6 +77,7 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS}) endforeach() # Look for libraries specified by COMPONENTS flag +set(Boost_LIBRARY_DIRS "Boost_LIBRARY_DIRS-NOTFOUND") find_path( Boost_LIBRARY_DIRS @@ -90,7 +89,6 @@ find_path( $ENV{BOOST_LIBRARYDIR} ${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost - PATHS /usr/lib/boost /usr/lib/x86_64-linux-gnu @@ -104,6 +102,7 @@ find_path( # targets, so they may be linked set(Boost_LIBRARIES ${REQUESTED_BOOST_LIBS}) foreach(LIBNAME ${Boost_LIBRARIES}) + set(${LIBNAME} "${LIBNAME}-NOTFOUND") find_library( ${LIBNAME} @@ -115,11 +114,7 @@ foreach(LIBNAME ${Boost_LIBRARIES}) $ENV{BOOST_LIBRARYDIR} ${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost - PATHS - ${BOOST_LIBRARYDIR} - $ENV{BOOST_LIBRARYDIR} - ${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost /usr/lib/boost /usr/lib/x86_64-linux-gnu