Revert to Fedora version of FindPythonLibs patch (bug #1072964)

This commit is contained in:
Orion Poplawski 2014-03-05 10:01:05 -07:00
parent e7d7e1f36e
commit 1f8a36aeea
2 changed files with 20 additions and 36 deletions

View File

@ -1,29 +1,7 @@
From 3816cd2dc7a7cc220e4f1b1e87fee986545b9cb3 Mon Sep 17 00:00:00 2001 diff -rupN cmake/Modules/FindPythonLibs.cmake new/Modules/FindPythonLibs.cmake
From: Matt McCormick <matt.mccormick@kitware.com> --- cmake/Modules/FindPythonLibs.cmake 2013-04-12 14:09:08.470669049 -0500
Date: Wed, 26 Feb 2014 21:47:20 -0500 +++ new/Modules/FindPythonLibs.cmake 2013-04-12 15:41:15.789496153 -0500
Subject: [PATCH] FindPythonLibs: Find consistent Python interp, headers, libs @@ -69,10 +69,21 @@ endif()
(#13794)
When possible, get consistent version of the Python interpreter, headers path,
and library.
Now find_package(PythonLibs) internally calls find_package(PythonInterp
QUIET) and uses the resulting PYTHON_VERSION_MAJOR and
PYTHON_VERSION_MINOR to prefer these versions when looking for the
header path and library. The Python_ADDITIONAL_VERSIONS variable has
priority over the interpreter version.
Co-Author: Adam Wolf
Co-Author: Gert Wollny <gw.fossdev@gmail.com>
---
Modules/FindPythonLibs.cmake | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 0749efc..27d9e45 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -80,10 +80,15 @@ endif()
# Set up the versions we know about, in the order we will search. Always add # Set up the versions we know about, in the order we will search. Always add
# the user supplied additional versions to the front. # the user supplied additional versions to the front.
@ -31,18 +9,21 @@ index 0749efc..27d9e45 100644
- ${Python_ADDITIONAL_VERSIONS} - ${Python_ADDITIONAL_VERSIONS}
- ${_PYTHON_FIND_OTHER_VERSIONS} - ${_PYTHON_FIND_OTHER_VERSIONS}
- ) - )
+# If FindPythonInterp has already found the major and minor version, +# If FindPythonInterp has already found the major and minor version,
+# insert that version between the user supplied versions and the stock +# insert that version between the user supplied versions and the stock
+# version list. +# version list.
+find_package(PythonInterp QUIET)
+set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS})
+if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR) +if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR)
+ list(APPEND _Python_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) + set(_Python_VERSIONS
+ ${Python_ADDITIONAL_VERSIONS}
+ ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
+ ${_PYTHON_FIND_OTHER_VERSIONS}
+ )
+else()
+ set(_Python_VERSIONS
+ ${Python_ADDITIONAL_VERSIONS}
+ ${_PYTHON_FIND_OTHER_VERSIONS}
+ )
+endif() +endif()
+list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS})
unset(_PYTHON_FIND_OTHER_VERSIONS) unset(_PYTHON_FIND_OTHER_VERSIONS)
unset(_PYTHON1_VERSIONS) unset(_PYTHON1_VERSIONS)
--
1.7.10.4

View File

@ -13,7 +13,7 @@
Name: cmake Name: cmake
Version: 3.0.0 Version: 3.0.0
Release: 0.3.rc1%{?dist} Release: 0.4.rc1%{?dist}
Summary: Cross-platform make system Summary: Cross-platform make system
Group: Development/Tools Group: Development/Tools
@ -236,6 +236,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%changelog %changelog
* Wed Mar 5 2014 Orion Poplawski <orion@cora.nwra.com> - 3.0.0-0.4.rc1
- Revert to Fedora version of FindPythonLibs patch (bug #1072964)
* Mon Mar 3 2014 Orion Poplawski <orion@cora.nwra.com> - 3.0.0-0.3.rc1 * Mon Mar 3 2014 Orion Poplawski <orion@cora.nwra.com> - 3.0.0-0.3.rc1
- Update to upstreams version of FindPythonLibs patch - Update to upstreams version of FindPythonLibs patch