Fix Boost detection, and allow more recent versions
- Removes version requirement that Boost version < 1.65
- Fixes Boost detection code. Previously, we were using the
wrong CMake macro (Boost_VERSION instead of Boost_MACRO_VERSION) to
check against the version. Boost_VERSION has a different format
for different versions, which Boost_MACRO_VERSION is the same for
all versions. Also, it was allowing 1.46 even though it says
1.47 in the user error message and comments.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2c29130..41b475d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -106,31 +106,22 @@
# -- Third-party dependencies: Find or download Boost --------------------------
+# set(Boost_INCLUDE_DIRS "/usr/local/opt/boost/include")
find_package(Boost 1.47)
if(Boost_FOUND)
# We use BOOST_ASSERT_MSG, which only exists in Boost 1.47 and later.
- # Unfortunately, the FindBoost module seems to be broken with respect to
- # version checking, so we will set Boost_FOUND to FALSE if the version is
- # too old.
- if(Boost_VERSION LESS 104600)
- message(STATUS "No sufficiently recent version (>= 1.47) of Boost was found. Will download.")
+ if(Boost_MACRO_VERSION LESS 104700)
set(Boost_FOUND FALSE)
- endif(Boost_VERSION LESS 104600)
-
- # BOOST 1.65.0 removed the TR1 library which is required by MADlib till
- # C++11 is completely supported. Hence, we force download of a compatible
- # version if existing Boost is 1.65 or greater. FIXME: This should be
- # removed when TR1 dependency is removed.
- if(NOT Boost_VERSION LESS 106500)
- message(STATUS
- "Incompatible Boost version (>= 1.65) found. Will download a compatible version.")
- set(Boost_FOUND FALSE)
- endif(NOT Boost_VERSION LESS 106500)
+ else(Boost_MACRO_VERSION LESS 104700)
+ message(STATUS "Actual version of Boost found: ${Boost_VERSION_STRING}")
+ endif(Boost_MACRO_VERSION LESS 104700)
endif(Boost_FOUND)
if(Boost_FOUND)
+ message(STATUS "Boost include directory ${Boost_INCLUDE_DIRS}")
include_directories(${Boost_INCLUDE_DIRS})
else(Boost_FOUND)
+ message(STATUS "No sufficiently recent version (>= 1.47) of Boost was found. Will download.")
ExternalProject_Add(EP_boost
PREFIX ${MAD_THIRD_PARTY}
DOWNLOAD_DIR ${MAD_THIRD_PARTY}/downloads