From 07fd1d53126df9d025565d440d80be176fa848f2 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Mon, 24 Jan 2022 14:49:48 -0800 Subject: [PATCH] Use Boost::python3 if Boost < 1.67 Signed-off-by: Shane Loretz --- cv_bridge/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cv_bridge/CMakeLists.txt b/cv_bridge/CMakeLists.txt index 428beff67..e6b18ddbc 100644 --- a/cv_bridge/CMakeLists.txt +++ b/cv_bridge/CMakeLists.txt @@ -24,10 +24,13 @@ else() # Resolution for newer versions: # https://gitlab.kitware.com/cmake/cmake/issues/16391 set(_Boost_PYTHON3_HEADERS "boost/python.hpp") + find_package(Boost REQUIRED COMPONENTS python3) + set(boost_python_target "Boost::python3") + else() + find_package(Python3 REQUIRED COMPONENTS Development NumPy) + find_package(Boost REQUIRED COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}) + set(boost_python_target "Boost::python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}") endif() - find_package(Python3 REQUIRED COMPONENTS Development NumPy) - find_package(Boost REQUIRED COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}) - set(boost_python_target "Boost::python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}") endif() find_package(sensor_msgs REQUIRED)