[Cmake-commits] CMake branch, next, updated. v3.3.1-3043-g43281fa

Brad King brad.king at kitware.com
Thu Sep 17 11:27:13 EDT 2015


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  43281fa5cdc480cc7601cd6d8c5901c7c0c6f40e (commit)
       via  b18e0e3c34fd2a931bbec5fe3e45a67588746d27 (commit)
      from  19d6c7b3a63a4ebb655507424e6116ed576ffc98 (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=43281fa5cdc480cc7601cd6d8c5901c7c0c6f40e
commit 43281fa5cdc480cc7601cd6d8c5901c7c0c6f40e
Merge: 19d6c7b b18e0e3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 17 11:27:12 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Sep 17 11:27:12 2015 -0400

    Merge topic 'FindPython-updates' into next
    
    b18e0e3c FindPythonLibs: Use python executable prefix as a hint


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b18e0e3c34fd2a931bbec5fe3e45a67588746d27
commit b18e0e3c34fd2a931bbec5fe3e45a67588746d27
Author:     David Gobbi <david.gobbi at gmail.com>
AuthorDate: Thu Sep 17 08:22:27 2015 -0600
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 17 11:26:39 2015 -0400

    FindPythonLibs: Use python executable prefix as a hint
    
    If PYTHON_EXECUTABLE is set, then we should look for the libs in the
    same prefix, e.g. /usr/local/python -> /usr/local/lib, and on Win32
    /Python34/python.exe -> /Python34/libs.

diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 19244da..ec9ee89 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -49,6 +49,23 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
+# Use the executable's path as a hint
+set(_Python_LIBRARY_PATH_HINT)
+if(PYTHON_EXECUTABLE)
+  if(WIN32)
+    get_filename_component(_PREFIX ${PYTHON_EXECUTABLE} PATH)
+    if(_PREFIX)
+      set(_Python_LIBRARY_PATH_HINT ${_PREFIX}/libs)
+    endif()
+  else()
+    get_filename_component(_PREFIX ${PYTHON_EXECUTABLE} PATH)
+    get_filename_component(_PREFIX ${_PREFIX} PATH)
+    if(_PREFIX)
+      set(_Python_LIBRARY_PATH_HINT ${_PREFIX}/lib)
+    endif()
+  endif()
+endif()
+
 include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake)
 # Search for the python framework on Apple.
 CMAKE_FIND_FRAMEWORKS(Python)
@@ -112,6 +129,7 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
   if(WIN32)
     find_library(PYTHON_DEBUG_LIBRARY
       NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
+      HINTS ${_Python_LIBRARY_PATH_HINT}
       PATHS
       [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
       [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
@@ -134,6 +152,8 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
       python${_CURRENT_VERSION}m
       python${_CURRENT_VERSION}u
       python${_CURRENT_VERSION}
+    HINTS
+      ${_Python_LIBRARY_PATH_HINT}
     PATHS
       ${PYTHON_FRAMEWORK_LIBRARIES}
       [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
@@ -202,6 +222,8 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
   endif()
 endforeach()
 
+unset(_Python_LIBRARY_PATH_HINT)
+
 mark_as_advanced(
   PYTHON_DEBUG_LIBRARY
   PYTHON_LIBRARY

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

Summary of changes:
 Modules/FindPythonLibs.cmake |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list