Add additional FindPythonLibs patch from upstream (bug #1072964)

This commit is contained in:
Orion Poplawski 2014-03-05 10:10:19 -07:00
parent 1f8a36aeea
commit cdf5b80727
3 changed files with 70 additions and 17 deletions

View File

@ -1,7 +1,29 @@
diff -rupN cmake/Modules/FindPythonLibs.cmake new/Modules/FindPythonLibs.cmake From 3816cd2dc7a7cc220e4f1b1e87fee986545b9cb3 Mon Sep 17 00:00:00 2001
--- cmake/Modules/FindPythonLibs.cmake 2013-04-12 14:09:08.470669049 -0500 From: Matt McCormick <matt.mccormick@kitware.com>
+++ new/Modules/FindPythonLibs.cmake 2013-04-12 15:41:15.789496153 -0500 Date: Wed, 26 Feb 2014 21:47:20 -0500
@@ -69,10 +69,21 @@ endif() Subject: [PATCH] FindPythonLibs: Find consistent Python interp, headers, libs
(#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.
@ -9,21 +31,18 @@ diff -rupN cmake/Modules/FindPythonLibs.cmake new/Modules/FindPythonLibs.cmake
- ${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)
+ set(_Python_VERSIONS + list(APPEND _Python_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
+ ${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

@ -0,0 +1,31 @@
From bf28ff1f422407f10ecc283f03ce8c5ee57f1812 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Wed, 5 Mar 2014 11:57:00 -0500
Subject: [PATCH] FindPythonLibs: Do not try to find the interpreter (#13794)
The parent commit taught FindPythonLibs to try to find PythonInterp
unconditionally. Some projects may want the libraries of a specific
version even when the corresponding interpreter is not available. Drop
the internal use of FindPythonInterp and just use the versions from it
if it happens to have been found by the project first. That will allow
projects to get a consistent version when they want both but not
otherwise force them to find the interpreter.
---
Modules/FindPythonLibs.cmake | 1 -
1 file changed, 1 deletion(-)
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 27d9e45..656ed7b 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -83,7 +83,6 @@ endif()
# If FindPythonInterp has already found the major and minor version,
# insert that version between the user supplied versions and the stock
# version list.
-find_package(PythonInterp QUIET)
set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS})
if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR)
list(APPEND _Python_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
--
1.7.10.4

View File

@ -54,6 +54,8 @@ Patch7: cmake-desktop_icon.patch
# Remove automatic Qt module dep adding # Remove automatic Qt module dep adding
# http://public.kitware.com/Bug/view.php?id=14750 # http://public.kitware.com/Bug/view.php?id=14750
Patch8: cmake-qtdeps.patch Patch8: cmake-qtdeps.patch
# Additiona python fixes from upstream
Patch9: cmake-FindPythonLibs2.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -123,6 +125,7 @@ The %{name}-gui package contains the Qt based GUI for CMake.
%patch6 -p1 %patch6 -p1
%patch7 -p1 %patch7 -p1
%patch8 -p1 %patch8 -p1
%patch9 -p1
# Setup copyright docs for main package # Setup copyright docs for main package
mkdir _doc mkdir _doc
find Source Utilities -type f -iname copy\* | while read f find Source Utilities -type f -iname copy\* | while read f
@ -237,7 +240,7 @@ 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 * 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) - Add additional FindPythonLibs patch from upstream (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