[PATCH 1/2] first proposal (not ideal)

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Thu Apr 11 13:59:55 EDT 2013


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

diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 7fb65b8..60a0f53 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -39,15 +39,17 @@ if(PythonInterp_FIND_VERSION)
     if(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
         string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonInterp_FIND_VERSION}")
         string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
-        list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN} python${_PYTHON_FIND_MAJ})
+        list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN})
         unset(_PYTHON_FIND_OTHER_VERSIONS)
         if(NOT PythonInterp_FIND_VERSION_EXACT)
             foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
                 if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
                     list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
+                    list(APPEND _Python_NAMES python${_PYTHON_V})
                 endif()
              endforeach()
         endif()
+        list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ})
         unset(_PYTHON_FIND_MAJ_MIN)
         unset(_PYTHON_FIND_MAJ)
     else()
-- 
1.8.0.2


--------------070208040302020609060907
Content-Type: text/x-patch;
 name="0002-second-proposal.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0002-second-proposal.patch"



More information about the CMake mailing list