Fix finding boost python >= 1.67

Boost >= 1.67 requires a version suffix (on macOS at least)
This commit is contained in:
Peter Lama
2018-04-20 11:07:53 -07:00
committed by wmayer
parent 3c9e6b038e
commit 68f25713d3

View File

@@ -16,18 +16,16 @@ OPTION(USE_BOOST_PYTHON "use BOOST_PYTHON, otherwise use PYBIND11" ON)
if(USE_BOOST_PYTHON)
if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
# for boost >= 1.67 we must add the Python version suffix to
# the component name
if (Boost_VERSION VERSION_GREATER 106699)
find_package(Boost COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR} REQUIRED) # find BOOST and boost-python
else()
if(NOT PYTHON_VERSION_MAJOR LESS 3)
find_package( Boost COMPONENTS python3)
if (NOT Boost_PYTHON3_FOUND)
find_package( Boost COMPONENTS python REQUIRED)
endif()
else()
find_package( Boost COMPONENTS python REQUIRED) # find BOOST and boost-python
# boost-python >= 1.67 on some platforms has suffix
set(BOOST_PY_SUFFIX ${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
find_package( Boost COMPONENTS python${BOOST_PY_SUFFIX} )
if (NOT Boost_PYTHON${BOOST_PY_SUFFIX}_FOUND)
# try just the major version
find_package( Boost COMPONENTS python${PYTHON_VERSION_MAJOR} )
if (NOT Boost_PYTHON${PYTHON_VERSION_MAJOR}_FOUND)
# unversioned
find_package( Boost COMPONENTS python REQUIRED)
endif()
endif()