Add overridable boost_python library name

This would be needed for updating boost to 1.67 or later - the python
bindings libraries changed their names to contain python version they
are built against. Also this naming change is backported to our boost
packages on linux.
This commit is contained in:
Victor Popov 2019-01-08 14:37:16 +03:00 committed by Sergey Yershov
parent 1f2bc65f3a
commit 10e9614012

View file

@ -165,10 +165,15 @@ endif()
if (PYBINDINGS)
if (PYTHON_VERSION VERSION_GREATER 3.0)
set(_Boost_PYTHON3_HEADERS "boost/python.hpp")
find_package(Boost 1.64 REQUIRED COMPONENTS python3)
if (NOT DEFINED BOOST_PYTHON_LIBNAME)
set(BOOST_PYTHON_LIBNAME python3)
endif()
else()
find_package(Boost 1.64 REQUIRED COMPONENTS python)
if (NOT DEFINED BOOST_PYTHON_LIBNAME)
set(BOOST_PYTHON_LIBNAME python)
endif()
endif()
find_package(Boost 1.64 REQUIRED COMPONENTS ${BOOST_PYTHON_LIBNAME})
find_package(PythonLibs ${PYTHON_VERSION} REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
endif()