File test_cmake_pyversion.patch of Package python-pybind11

Index: pybind11/tests/CMakeLists.txt
===================================================================
--- pybind11.orig/tests/CMakeLists.txt	2021-01-30 17:11:34.849003057 +0100
+++ pybind11/tests/CMakeLists.txt	2021-01-30 17:11:34.841003034 +0100
@@ -47,15 +47,19 @@
   endforeach()
 endmacro()
 
+# There's no harm in including a project in a project
+project(pybind11_tests CXX)
+
+if(DEFINED PYVERSION)
+  find_package(Python ${PYVERSION} EXACT COMPONENTS Interpreter Development)
+endif()
+
 # New Python support
 if(DEFINED Python_EXECUTABLE)
   set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}")
   set(PYTHON_VERSION "${Python_VERSION}")
 endif()
 
-# There's no harm in including a project in a project
-project(pybind11_tests CXX)
-
 # Access FindCatch and more
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../tools")
 
openSUSE Build Service is sponsored by