From b72ee653328539fd54c4f338afa154daa9c8807f Mon Sep 17 00:00:00 2001 From: agrayver Date: Mon, 28 Oct 2019 13:44:37 +0100 Subject: [PATCH] Keep compatibility --- contrib/python-bindings/source/CMakeLists.txt | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/contrib/python-bindings/source/CMakeLists.txt b/contrib/python-bindings/source/CMakeLists.txt index dceed12782..d774d0ac5e 100644 --- a/contrib/python-bindings/source/CMakeLists.txt +++ b/contrib/python-bindings/source/CMakeLists.txt @@ -29,14 +29,22 @@ IF(FEATURE_BOOST_BUNDLED_CONFIGURED) ENDIF() # -# Unset Boost_Found and run the low level FindBOOST.cmake module again to -# pick up libboost_python.so +# As of 1.67, boost requires specifying the suffix for the python +# component manually. # -LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) -SET(Boost_FOUND) -# Use the low level _FIND_PACKAGE function instead of our wrapper -_FIND_PACKAGE(Boost 1.59 COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED) -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) +IF(${BOOST_VERSION} VERSION_LESS 1.67) + # + # Unset Boost_Found and run the low level FindBOOST.cmake module again to + # pick up libboost_python.so + # + LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) + SET(Boost_FOUND) + # Use the low level _FIND_PACKAGE function instead of our wrapper + _FIND_PACKAGE(Boost 1.59 COMPONENTS python REQUIRED) + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/) +ELSE() + _FIND_PACKAGE(Boost 1.67 COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED) +ENDIF() IF(NOT Boost_FOUND) MESSAGE(FATAL_ERROR -- 2.39.5