Package: shiboken / 1.2.2-3.1

pythonversionindep.patch Patch series | download
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From a88074e79510202f66863e2a4e0d2220ec1cc8e6 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Thu, 8 Oct 2015 13:47:13 -0700
Subject: Allow the packaging definitions to pick the desired python version
 and compilation flags in both Python2 and Python3.

Last-Update: 2014-04-30
Patch-Name: pythonversionindep.patch
---
 cmake/Modules/FindPython3Interp.cmake         | 3 +++
 cmake/Modules/FindPython3Libs.cmake           | 4 ++--
 cmake/Modules/FindPythonInterpWithDebug.cmake | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/cmake/Modules/FindPython3Interp.cmake b/cmake/Modules/FindPython3Interp.cmake
index 373982e..b364ab0 100644
--- a/cmake/Modules/FindPython3Interp.cmake
+++ b/cmake/Modules/FindPython3Interp.cmake
@@ -19,6 +19,8 @@
 # (To distributed this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+IF(NOT DEFINED PYTHON3_EXECUTABLE)
+
 FIND_PROGRAM(PYTHON3_EXECUTABLE
   NAMES python3.2mu python3.2m python3.2u python3.2 python3.1 python3.0 python3
   PATHS
@@ -35,6 +37,7 @@ FIND_PROGRAM(PYTHON3_DBG_EXECUTABLE
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.0\\InstallPath]
   )
 
+ENDIF()
 
 # handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
 # all listed variables are TRUE
diff --git a/cmake/Modules/FindPython3Libs.cmake b/cmake/Modules/FindPython3Libs.cmake
index 20a82ba..5caf0bf 100644
--- a/cmake/Modules/FindPython3Libs.cmake
+++ b/cmake/Modules/FindPython3Libs.cmake
@@ -27,13 +27,13 @@ INCLUDE(CMakeFindFrameworks)
 # Search for the python framework on Apple.
 # CMAKE_FIND_FRAMEWORKS(Python)
 
-FOREACH(_CURRENT_VERSION 3.4 3.3 3.2 3.1 3.0)
+FOREACH(_CURRENT_VERSION ${CMAKE_USE_PYTHON_VERSION})
   IF(_CURRENT_VERSION GREATER 3.1)
       SET(_32FLAGS "m" "u" "mu" "dm" "du" "dmu" "")
   ELSE()
       SET(_32FLAGS "")
   ENDIF()
-  FOREACH(_COMPILATION_FLAGS ${_32FLAGS})
+  FOREACH(_COMPILATION_FLAGS ${CMAKE_USE_PYTHON_COMPILATION_FLAGS})
       STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
       IF(WIN32)
         IF(_CURRENT_VERSION GREATER 3.1)
diff --git a/cmake/Modules/FindPythonInterpWithDebug.cmake b/cmake/Modules/FindPythonInterpWithDebug.cmake
index 7722d95..74f1025 100644
--- a/cmake/Modules/FindPythonInterpWithDebug.cmake
+++ b/cmake/Modules/FindPythonInterpWithDebug.cmake
@@ -1,4 +1,4 @@
-find_program(PYTHON_EXECUTABLE NAMES python2.7 python2.6 python2.5)
+# find_program(PYTHON_EXECUTABLE NAMES python2.7 python2.6 python2.5)
 
 if (NOT PYTHON_EXECUTABLE)
     find_package(PythonInterp REQUIRED)