@@ -12,28 +12,23 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1212 add_compile_options (-Wall -Wextra)
1313endif ()
1414
15- if (NOT ANDROID)
16- find_package (PythonLibs)
17- if (PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
18- find_package (Boost REQUIRED python)
19- else ()
20- find_package (Boost QUIET )
21- if (Boost_VERSION LESS 106500)
22- find_package (Boost REQUIRED python)
23- else ()
24- # This is a bit of a hack to suppress a warning
25- # No header defined for python3; skipping header check
26- # Which should only affect Boost versions < 1.67
27- # Resolution for newer versions:
28- # https://gitlab.kitware.com/cmake/cmake/issues/16391
29- if (Boost_VERSION LESS 106700)
30- set (_Boost_PYTHON3_HEADERS "boost/python.hpp" )
31- endif ()
32- find_package (Boost COMPONENTS python3 REQUIRED)
33- endif ()
34- endif ()
15+ if (ANDROID)
16+ find_package (Boost REQUIRED)
17+ set (boost_python_target "" )
3518else ()
36- find_package (Boost REQUIRED COMPONENTS python)
19+ find_package (Python3 REQUIRED COMPONENTS Development NumPy)
20+ find_package (Boost QUIET )
21+ if (Boost_VERSION_STRING VERSION_LESS "1.67" )
22+ # This is a bit of a hack to suppress a warning
23+ # No header defined for python3; skipping header check
24+ # Which should only affect Boost versions < 1.67
25+ # Resolution for newer versions:
26+ # https://gitlab.kitware.com/cmake/cmake/issues/16391
27+ set (_Boost_PYTHON3_HEADERS "boost/python.hpp" )
28+ endif ()
29+ find_package (Python3 REQUIRED COMPONENTS Development NumPy)
30+ find_package (Boost REQUIRED COMPONENTS python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} )
31+ set (boost_python_target "Boost::python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} " )
3732endif ()
3833
3934find_package (rcpputils REQUIRED)
0 commit comments