]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
cmake: look for Boost in-tree first
authorMatthew Barr <matthew.barr@intel.com>
Thu, 16 Mar 2017 05:58:42 +0000 (16:58 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Apr 2017 05:17:19 +0000 (15:17 +1000)
During development we tend to use a symlink to the most recent version of
Boost from the Hyperscan source tree, so look there first.

Also, unset some cached results so we recheck when the Boost version changes.

CMakeLists.txt
cmake/boost.cmake

index 0fd3639fc39e0e28588a60abea40c47f016f633f..0776e42cfa0bd27c4ab78f26ececb174b10bc7a7 100644 (file)
@@ -72,18 +72,21 @@ else ()
 endif ()
 set(BOOST_NO_BOOST_CMAKE ON)
 
-# first check for Boost installed on the system
-find_package(Boost ${BOOST_MINVERSION})
+unset(Boost_INCLUDE_DIR CACHE)
+# we might have boost in tree, so provide a hint and try again
+set(BOOST_INCLUDEDIR "${PROJECT_SOURCE_DIR}/include")
+find_package(Boost ${BOOST_MINVERSION} QUIET)
 if(NOT Boost_FOUND)
-    # we might have boost in tree, so provide a hint and try again
-    message(STATUS "trying include dir for boost")
-    set(BOOST_INCLUDEDIR "${PROJECT_SOURCE_DIR}/include")
-    find_package(Boost ${BOOST_MINVERSION})
+    # otherwise check for Boost installed on the system
+    unset(BOOST_INCLUDEDIR)
+    find_package(Boost ${BOOST_MINVERSION} QUIET)
     if(NOT Boost_FOUND)
         message(FATAL_ERROR "Boost ${BOOST_MINVERSION} or later not found. Either install system packages if available, extract Boost headers to ${CMAKE_SOURCE_DIR}/include, or set the CMake BOOST_ROOT variable.")
     endif()
 endif()
 
+message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
+
 include (${CMAKE_MODULE_PATH}/boost.cmake)
 
 # -- make this work? set(python_ADDITIONAL_VERSIONS 2.7 2.6)
index 3d513deb64365fe4697c40736e0219fe2ac0f464..b7fda4214735bdc0545fdeafdadaeeedd59fa953 100644 (file)
@@ -38,4 +38,7 @@ ${BOOST_REV_TEST}" BOOST_REVGRAPH_PATCH)
     endif()
 
     unset (CMAKE_REQUIRED_INCLUDES)
+else ()
+    unset(BOOST_REVGRAPH_OK CACHE)
+    unset(BOOST_REVGRAPH_PATCH CACHE)
 endif () # Boost 1.62.0