summaryrefslogtreecommitdiff
path: root/dev-build/cmake/files/cmake-3.9.0_rc2-FindPythonInterp.patch
blob: 242392d8520e7df90ba7a8c91cfd74304f945730 (plain)
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
From 325652950ecc5d72f0a6ac843889a048fe9e32cf Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Fri, 9 Jun 2017 02:08:03 +0200
Subject: [PATCH] Don't mess with python versions too much

---
 Modules/FindPythonInterp.cmake | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 64b98a879..73bd35b56 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -64,6 +64,11 @@ if(PythonInterp_FIND_VERSION)
 else()
     set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
 endif()
+
+if (CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo)
+    set(_Python_NAMES python)
+endif()
+
 find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
 
 # Set up the versions we know about, in the order we will search. Always add
@@ -88,12 +93,13 @@ unset(_PYTHON2_VERSIONS)
 unset(_PYTHON3_VERSIONS)
 
 # Search for newest python version if python executable isn't found
-if(NOT PYTHON_EXECUTABLE)
+if(NOT PYTHON_EXECUTABLE AND NOT (CMAKE_GENTOO_BUILD OR CMAKE_BUILD_TYPE STREQUAL Gentoo))
     foreach(_CURRENT_VERSION IN LISTS _Python_VERSIONS)
       set(_Python_NAMES python${_CURRENT_VERSION})
       if(CMAKE_HOST_WIN32)
         list(APPEND _Python_NAMES python)
       endif()
+
       find_program(PYTHON_EXECUTABLE
         NAMES ${_Python_NAMES}
         PATHS
-- 
2.13.1