From 2a5720ccb33a2428e325ebdca366e8a54a16e2f7 Mon Sep 17 00:00:00 2001 From: Martin Beseda <martinbeseda@seznam.cz> Date: Fri, 7 Sep 2018 14:36:07 +0200 Subject: [PATCH] FIX: Boost_* variables are now deleted from cache to prevent preserving wrong paths. --- FindBoost.cmake | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/FindBoost.cmake b/FindBoost.cmake index d596c8d9..74015b4c 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 -- GitLab