ngompa / rpms / cmake

Forked from rpms/cmake 4 years ago
Clone
f9cb51
diff -rupN cmake/Modules/FindPythonLibs.cmake new/Modules/FindPythonLibs.cmake
f9cb51
--- cmake/Modules/FindPythonLibs.cmake	2013-04-12 14:09:08.470669049 -0500
f9cb51
+++ new/Modules/FindPythonLibs.cmake	2013-04-12 15:41:15.789496153 -0500
f9cb51
@@ -69,10 +69,21 @@ endif()
f9cb51
 
f9cb51
 # Set up the versions we know about, in the order we will search. Always add
f9cb51
 # the user supplied additional versions to the front.
f9cb51
-set(_Python_VERSIONS
f9cb51
-  ${Python_ADDITIONAL_VERSIONS}
f9cb51
-  ${_PYTHON_FIND_OTHER_VERSIONS}
f9cb51
-  )
f9cb51
+# If FindPythonInterp has already found the major and minor version, 
f9cb51
+# insert that version between the user supplied versions and the stock
f9cb51
+# version list. 
f9cb51
+if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR)
f9cb51
+  set(_Python_VERSIONS
f9cb51
+    ${Python_ADDITIONAL_VERSIONS}
f9cb51
+    ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
f9cb51
+    ${_PYTHON_FIND_OTHER_VERSIONS}
f9cb51
+    )
f9cb51
+else()
f9cb51
+  set(_Python_VERSIONS
f9cb51
+    ${Python_ADDITIONAL_VERSIONS}
f9cb51
+    ${_PYTHON_FIND_OTHER_VERSIONS}
f9cb51
+    )
f9cb51
+endif()
f9cb51
 
f9cb51
 unset(_PYTHON_FIND_OTHER_VERSIONS)
f9cb51
 unset(_PYTHON1_VERSIONS)