Skip to content

Commit

Permalink
fix find boost-python for cv_bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
flynneva committed May 12, 2021
1 parent 05062b2 commit 2e59c59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cv_bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

if(NOT ANDROID)
find_package(PythonLibs)
find_package(PythonLibs REQUIRED)
if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
find_package(Boost REQUIRED python)
else()
Expand All @@ -29,7 +29,10 @@ if(NOT ANDROID)
if (Boost_VERSION LESS 106700)
set(_Boost_PYTHON3_HEADERS "boost/python.hpp")
endif()
find_package(Boost COMPONENTS python3 REQUIRED)
string(REPLACE "." ";" VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
list(GET VERSION_LIST 0 PYTHONLIBS_VERSION_MAJOR)
list(GET VERSION_LIST 1 PYTHONLIBS_VERSION_MINOR)
find_package(Boost COMPONENTS python${PYTHONLIBS_VERSION_MAJOR}${PYTHONLIBS_VERSION_MINOR} REQUIRED)
endif()
endif()
else()
Expand Down

0 comments on commit 2e59c59

Please sign in to comment.