[Cmake-commits] CMake branch, next, updated. v3.0.0-rc1-1025-gccab252

Brad King brad.king at kitware.com
Fri Mar 14 09:14:29 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  ccab25270642b610f00f31960adde7b4bf987d8c (commit)
       via  59220198022d2e081ddba164c1ec62a6e9d438eb (commit)
       via  a9e6de2acc1ac2e51b4d737b3abbeee3bf43832c (commit)
      from  c126b8c14505282cc22af4b719b58114f78c83f7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ccab25270642b610f00f31960adde7b4bf987d8c
commit ccab25270642b610f00f31960adde7b4bf987d8c
Merge: c126b8c 5922019
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Mar 14 09:14:28 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Mar 14 09:14:28 2014 -0400

    Merge topic 'different-python-header-libs-exe-0013794' into next
    
    59220198 FindPython*: Document suggested find_package order (#13794)
    a9e6de2a FindPythonInterp: Use consistent version with PythonLibs (#13794)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59220198022d2e081ddba164c1ec62a6e9d438eb
commit 59220198022d2e081ddba164c1ec62a6e9d438eb
Author:     Matt McCormick <matt.mccormick at kitware.com>
AuthorDate: Thu Mar 13 11:19:11 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 14 09:11:26 2014 -0400

    FindPython*: Document suggested find_package order (#13794)
    
    Document in both FindPythonInterp.cmake and FindPythonLibs.cmake that
    find_package(PythonInterp) should be called before find_package(PythonLibs).

diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 780cda8..f8ff5d8 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -27,6 +27,10 @@
 # of version numbers that should be taken into account when searching
 # for Python.  You need to set this variable before calling
 # find_package(PythonInterp).
+#
+# If also calling find_package(PythonLibs), call find_package(PythonInterp)
+# first to get the currently active Python version by default with a consistent
+# version of PYTHON_LIBRARIES.
 
 #=============================================================================
 # Copyright 2005-2010 Kitware, Inc.
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 656ed7b..1f90f5b 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -31,6 +31,10 @@
 #
 #   PYTHON_LIBRARY             - path to the python library
 #   PYTHON_INCLUDE_DIR         - path to where Python.h is found
+#
+# If also calling find_package(PythonInterp), call find_package(PythonInterp)
+# first to get the currently active Python version by default with a consistent
+# version of PYTHON_LIBRARIES.
 
 #=============================================================================
 # Copyright 2001-2009 Kitware, Inc.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a9e6de2acc1ac2e51b4d737b3abbeee3bf43832c
commit a9e6de2acc1ac2e51b4d737b3abbeee3bf43832c
Author:     Matt McCormick <matt.mccormick at kitware.com>
AuthorDate: Wed Mar 5 17:01:26 2014 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 14 09:09:58 2014 -0400

    FindPythonInterp: Use consistent version with PythonLibs (#13794)
    
    If
    
      find_package(PythonLibs)
      find_package(PythonInterp)
    
    is called, help PythonInterp to get a version of PYTHON_EXECUTABLE
    consistent with the library versions found by PythonLibs.

diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 8da848c..780cda8 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -71,18 +71,23 @@ if(PythonInterp_FIND_VERSION)
 else()
     set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
 endif()
-
-list(APPEND _Python_NAMES python)
-
-# Search for the current active python version first
 find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
 
 # Set up the versions we know about, in the order we will search. Always add
 # the user supplied additional versions to the front.
-set(_Python_VERSIONS
-  ${Python_ADDITIONAL_VERSIONS}
-  ${_PYTHON_FIND_OTHER_VERSIONS}
-  )
+set(_Python_VERSIONS ${Python_ADDITIONAL_VERSIONS})
+# If FindPythonInterp has already found the major and minor version,
+# insert that version next to get consistent versions of the interpreter and
+# library.
+if(DEFINED PYTHONLIBS_VERSION_STRING)
+  string(REPLACE "." ";" _PYTHONLIBS_VERSION "${PYTHONLIBS_VERSION_STRING}")
+  list(GET _PYTHONLIBS_VERSION 0 _PYTHONLIBS_VERSION_MAJOR)
+  list(GET _PYTHONLIBS_VERSION 1 _PYTHONLIBS_VERSION_MINOR)
+  list(APPEND _Python_VERSIONS ${_PYTHONLIBS_VERSION_MAJOR}.${_PYTHONLIBS_VERSION_MINOR})
+endif()
+# Search for the current active python version first
+list(APPEND _Python_VERSIONS ";")
+list(APPEND _Python_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS})
 
 unset(_PYTHON_FIND_OTHER_VERSIONS)
 unset(_PYTHON1_VERSIONS)
@@ -91,7 +96,7 @@ unset(_PYTHON3_VERSIONS)
 
 # Search for newest python version if python executable isn't found
 if(NOT PYTHON_EXECUTABLE)
-    foreach(_CURRENT_VERSION ${_Python_VERSIONS})
+    foreach(_CURRENT_VERSION IN LISTS _Python_VERSIONS)
       set(_Python_NAMES python${_CURRENT_VERSION})
       if(WIN32)
         list(APPEND _Python_NAMES python)

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list