Hi,

On Wed, 11 Dec 2019 at 00:45, Johannes 'josch' Schauer <jo...@debian.org> wrote:
>
> Package: libboost-python1.67-dev
> Version: 1.67.0-15
> Severity: important
>
> Hi,
>
> I'm using the following CMakeLists.txt:
>
>     cmake_minimum_required(VERSION 3.13)
>     project(foo)
>     find_package(PythonLibs 3 REQUIRED)
>     find_package(Boost 1.45.0 COMPONENTS "python3" REQUIRED)
>

Above uses obsolete ways of finding both python and boost-python components.

PythonLibs has moved onto to just Python, with components.
Boost has moved onto providing fixed abi components only, without any
"convenience" libraries. After all, one cannot simply change
boost_python3 so-name to be 3.8 instead of 3.7.
Added bonus, this new way works across all OSes and Distros, be it
Debian/Ubuntu/Fedora/RHEL/Windows/MacOSX/vanilla-upstream-self-compiled.

The new way of doing things is shown in our autopkgtests:
https://salsa.debian.org/debian/boost/raw/master/debian/tests/srcs/python/CMakeLists.txt

NB! note that python3-dev or python3-all-dev is needed
NB! note that there are slightly different names for the Python_*
variables i.e. one may need to change PYTHON_* variables to Python_
with new suffixes

Which will be updated if things change in the future, including here
verbatim for convenience

project(Boost CXX)
cmake_minimum_required(VERSION 3.0)

FIND_PACKAGE(Python 3 REQUIRED COMPONENTS Interpreter Development)
INCLUDE_DIRECTORIES( ${Python_INCLUDE_DIR} )

FIND_PACKAGE(Boost COMPONENTS
python${Python_VERSION_MAJOR}${Python_VERSION_MINOR} REQUIRED)
INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})

ADD_LIBRARY(demo1 SHARED demo1.cpp)
TARGET_LINK_LIBRARIES(demo1 ${Boost_LIBRARIES} ${Python_LIBRARIES})

ADD_LIBRARY(demo2 SHARED demo2.cpp)
TARGET_LINK_LIBRARIES(demo2 ${Boost_LIBRARIES} ${Python_LIBRARIES})

Or forexample, you can query what the currenty py3versions default
version is and requet pythonXY boost component that way.

> Everything works fine on Debian Buster with libboost-python1.67-dev
> version 1.67.0-13:

This new way of doing things, will also work on prior debian releases.

python python3 python-pyXY are all obsolete (and at times Debian-only)
abi symlinks

python27 python37 python38 are the only ones that are going to be
available going forward, and also have been available in the past.

Please adjust your CMakeLists for the future.

-- 
Regards,

Dimitri.

Reply via email to