diff --git a/CMakeLists.txt b/CMakeLists.txt index 499afebc..e7bbc67b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,9 +250,11 @@ endif() # Find SWIG find_package(SWIG 4.0 COMPONENTS python) if(SWIG_FOUND) - find_package(PythonLibs REQUIRED) - if(PYTHONLIBS_FOUND) + find_package(Python3 COMPONENTS Interpreter Development) + if(PYTHON3_FOUND) set(HAVE_SWIG 1) + else() + message(STATUS "Found SWIG but no Python3 header/library; cannot use SWIG") endif() endif()