1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
From: Nicolas Dandrimont <olasd@debian.org>
Date: Mon, 20 Jan 2020 12:37:08 +0100
Subject: Allow overriding the Python version in CMake
---
CMakeLists.txt | 2 +-
cmake/FindSIP.cmake | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,8 +27,8 @@ if(BUILD_PYTHON)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
# FIXME: Use FindPython3 to find Python, new in CMake 3.12.
# However currently on our CI server it finds the wrong Python version and then doesn't find the headers.
- find_package(PythonInterp 3.4 REQUIRED)
- find_package(PythonLibs 3.4 REQUIRED)
+ find_package(PythonInterp ${PYVER} EXACT REQUIRED)
+ find_package(PythonLibs ${PYVER} EXACT REQUIRED)
else()
# Use FindPython3 for CMake >=3.12
--- a/cmake/FindSIP.cmake
+++ b/cmake/FindSIP.cmake
@@ -26,8 +26,8 @@ endif()
# FIXME: Use the new FindPython3 module rather than these. New in CMake 3.12.
# However currently that breaks on our CI server, since the CI server finds the built-in Python3.6 and then doesn't find the headers.
-find_package(PythonInterp 3.5 REQUIRED)
-find_package(PythonLibs 3.5 REQUIRED)
+find_package(PythonInterp ${PYVER} EXACT REQUIRED)
+find_package(PythonLibs ${PYVER} EXACT REQUIRED)
# Define variables that are available in FindPython3, so there's no need to branch off in the later part.
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
|