From 2d66f8e6c979149ff5254b8cc61540617bf5c103 Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Wed, 21 Aug 2019 10:49:23 -0400 Subject: cmake: add python38 to list of versions searched for boost components Also, factor out actual search code (identical across versions). Signed-off-by: Gabriel Somlo --- CMakeLists.txt | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f662dbe7..77745f95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,24 +161,13 @@ if (BUILD_PYTHON) endwhile () if (NOT Boost_PYTHON_FOUND) - find_package(Boost QUIET COMPONENTS python3 ${boost_libs}) - if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" ) - set(Boost_PYTHON_FOUND TRUE) - endif () - endif () - - if (NOT Boost_PYTHON_FOUND) - find_package(Boost QUIET COMPONENTS python36 ${boost_libs}) - if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" ) - set(Boost_PYTHON_FOUND TRUE) - endif () - endif () - - if (NOT Boost_PYTHON_FOUND) - find_package(Boost QUIET COMPONENTS python37 ${boost_libs}) - if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" ) - set(Boost_PYTHON_FOUND TRUE) - endif () + foreach (PyVer 3 36 37 38) + find_package(Boost QUIET COMPONENTS python${PyVer} ${boost_libs}) + if ("${Boost_LIBRARIES}" MATCHES ".*(python|PYTHON).*" ) + set(Boost_PYTHON_FOUND TRUE) + break() + endif () + endforeach () endif () if (NOT Boost_PYTHON_FOUND) -- cgit v1.2.3