Build: Skip Python development without pyverbs Request only the interpreter when pyverbs is disabled; development files are needed only for pyverbs. This came up when trying to cross-compile x86 to armv7l in Nix: https://github.com/NixOS/nixpkgs/pull/572620 Signed-off-by: Flaviu Tamas <me@flaviutamas.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ccd87f..1ce91e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -231,7 +231,11 @@ FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) elseif (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12") set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) - FIND_PACKAGE(Python 3 REQUIRED COMPONENTS Interpreter OPTIONAL_COMPONENTS Development) + if(NO_PYVERBS) + FIND_PACKAGE(Python 3 REQUIRED COMPONENTS Interpreter) + else() + FIND_PACKAGE(Python 3 REQUIRED COMPONENTS Interpreter OPTIONAL_COMPONENTS Development) + endif() set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) if(Python_Development_FOUND) set(PYTHONLIBS_FOUND ${Python_Development_FOUND})