[Cmake-commits] CMake branch, next, updated. v3.3.0-rc3-807-ga1c8ac3
Matt McCormick
matt.mccormick at kitware.com
Fri Jul 3 05:34:47 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 a1c8ac3911b6af3f34a634ff9c7cb3657abdc228 (commit)
via 0925f5f17364ed7e98349aebdb616e68efc392c6 (commit)
from 5d3276f7d3a1b99fc985d0fa587987c1271fc407 (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=a1c8ac3911b6af3f34a634ff9c7cb3657abdc228
commit a1c8ac3911b6af3f34a634ff9c7cb3657abdc228
Merge: 5d3276f 0925f5f
Author: Matt McCormick <matt.mccormick at kitware.com>
AuthorDate: Fri Jul 3 05:34:46 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jul 3 05:34:46 2015 -0400
Merge topic 'osx-pythondotorg-libs' into next
0925f5f1 FindPythonLibs: Find the python.org libraries.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0925f5f17364ed7e98349aebdb616e68efc392c6
commit 0925f5f17364ed7e98349aebdb616e68efc392c6
Author: Matt McCormick <matt.mccormick at kitware.com>
AuthorDate: Thu Jul 2 11:21:08 2015 -0400
Commit: Matt McCormick <matt.mccormick at kitware.com>
CommitDate: Thu Jul 2 13:09:34 2015 -0400
FindPythonLibs: Find the python.org libraries.
Per issue #0014809, this addresses the test case
cmake_minimum_required(VERSION 2.8)
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6)
find_package(PythonLibs 3 REQUIRED)
with a Python 3.4.x .pkg installed from python.org on OSX.
Temporarily set CMAKE_PREFIX_PATH to LAST to avoid finding the system Python.h
prematurely.
Add directories inside the frameworks to the search list for the library
as is done for the header.
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index cc875ad..b80d3ce 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -53,6 +53,15 @@ include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake)
# Search for the python framework on Apple.
CMAKE_FIND_FRAMEWORKS(Python)
+# Save CMAKE_FIND_FRAMEWORK
+if(DEFINED CMAKE_FIND_FRAMEWORK)
+ set(_PythonLibs_CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK})
+else()
+ unset(_PythonLibs_CMAKE_FIND_FRAMEWORK)
+endif()
+# To avoid picking up the system Python.h pre-maturely.
+set(CMAKE_FIND_FRAMEWORK LAST)
+
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.4 3.3 3.2 3.1 3.0)
@@ -111,14 +120,22 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
)
endif()
+ set(PYTHON_FRAMEWORK_LIBRARIES)
+ if(Python_FRAMEWORKS AND NOT PYTHON_LIBRARY)
+ foreach(dir ${Python_FRAMEWORKS})
+ list(APPEND PYTHON_FRAMEWORK_LIBRARIES
+ ${dir}/Versions/${_CURRENT_VERSION}/lib)
+ endforeach()
+ endif()
find_library(PYTHON_LIBRARY
NAMES
- python${_CURRENT_VERSION_NO_DOTS}
- python${_CURRENT_VERSION}mu
- python${_CURRENT_VERSION}m
- python${_CURRENT_VERSION}u
- python${_CURRENT_VERSION}
+ python${_CURRENT_VERSION_NO_DOTS}
+ python${_CURRENT_VERSION}mu
+ python${_CURRENT_VERSION}m
+ python${_CURRENT_VERSION}u
+ python${_CURRENT_VERSION}
PATHS
+ ${PYTHON_FRAMEWORK_LIBRARIES}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
# Avoid finding the .dll in the PATH. We want the .lib.
@@ -143,8 +160,8 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
set(PYTHON_FRAMEWORK_INCLUDES)
if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
foreach(dir ${Python_FRAMEWORKS})
- set(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
- ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
+ list(APPEND PYTHON_FRAMEWORK_INCLUDES
+ ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION})
endforeach()
endif()
@@ -201,6 +218,14 @@ SELECT_LIBRARY_CONFIGURATIONS(PYTHON)
# for historical reasons.
unset(PYTHON_FOUND)
+# Restore CMAKE_FIND_FRAMEWORK
+if(DEFINED _PythonLibs_CMAKE_FIND_FRAMEWORK)
+ set(CMAKE_FIND_FRAMEWORK ${_PythonLibs_CMAKE_FIND_FRAMEWORK})
+ unset(_PythonLibs_CMAKE_FIND_FRAMEWORK)
+else()
+ unset(CMAKE_FIND_FRAMEWORK)
+endif()
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
-----------------------------------------------------------------------
Summary of changes:
Modules/FindPythonLibs.cmake | 39 ++++++++++++++++++++++++++++++++-------
1 file changed, 32 insertions(+), 7 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list