From d3f19cc27ea4634a64821688e9adec6046f4d7de Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 6 Jun 2018 11:27:02 +0200 Subject: [PATCH] cmake: Fix Boost::Python finder on Gentoo Signed-off-by: David Shah --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index db866b5f..7b50e1d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,8 +52,22 @@ endwhile () if (NOT Boost_PYTHON_FOUND) find_package(Boost COMPONENTS python3 ${boost_libs}) + if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" ) + set(Boost_PYTHON_FOUND TRUE) + endif () endif () +if (NOT Boost_PYTHON_FOUND) + STRING(REGEX REPLACE "([0-9]+\\.[0-9]+).*" "\\1" gentoo_version ${PYTHONLIBS_VERSION_STRING}) + find_package(Boost COMPONENTS python-${gentoo_version} ${boost_libs}) + if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" ) + set(Boost_PYTHON_FOUND TRUE) + endif () +endif () + +if (NOT Boost_PYTHON_FOUND ) + message( FATAL_ERROR "No version of Boost::Python 3.x could be found.") +endif () include(gui/gui.cmake) include_directories(common/ gui/ ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})