From 2db092b1f60b3677a2d44d5563bec216ae687e2f Mon Sep 17 00:00:00 2001 From: David Gobbi Date: Mon, 14 Sep 2015 21:44:36 -0600 Subject: [PATCH 1/3] FindPython{Interp,Libs}: Add versions 3.5 and 3.6 --- Modules/FindPythonInterp.cmake | 2 +- Modules/FindPythonLibs.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake index 8784e18d5..879192eb3 100644 --- a/Modules/FindPythonInterp.cmake +++ b/Modules/FindPythonInterp.cmake @@ -51,7 +51,7 @@ unset(_Python_NAMES) 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) +set(_PYTHON3_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0) if(PythonInterp_FIND_VERSION) if(PythonInterp_FIND_VERSION_COUNT GREATER 1) diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index b80d3ce94..d01fae4fd 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -64,7 +64,7 @@ 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) +set(_PYTHON3_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0) if(PythonLibs_FIND_VERSION) if(PythonLibs_FIND_VERSION_COUNT GREATER 1) From c57334fae9c1b007d227d81f1078706d1399746f Mon Sep 17 00:00:00 2001 From: David Gobbi Date: Mon, 14 Sep 2015 22:44:15 -0600 Subject: [PATCH 2/3] FindPythonLibs: Remove PYTHON_INCLUDE_PATH as input This cmake variable has been deprecated for over a decade, and using it as an input could potentially cause unexpected results. We still need to keep it as an output variable for compatibility though. --- Modules/FindPythonLibs.cmake | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index d01fae4fd..127662d6b 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -150,13 +150,6 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS}) PATH_SUFFIXES python${_CURRENT_VERSION}/config ) - # For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if - # PYTHON_INCLUDE_DIR is not set. - if(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR) - set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH - "Path to where Python.h is found" FORCE) - endif() - set(PYTHON_FRAMEWORK_INCLUDES) if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR) foreach(dir ${Python_FRAMEWORKS}) From ea2db3bb02b356ce46065789f60c1ed1a77eb995 Mon Sep 17 00:00:00 2001 From: David Gobbi Date: Mon, 14 Sep 2015 22:48:49 -0600 Subject: [PATCH 3/3] FindPythonLibs: Fix OS X framework include directory search path We use PATH_SUFFIXES to append "python" to each candidate path. Do not append it to the constructed list of python framework include directories. Otherwise the combined path will never exist. Note that the code doesn't yet try to match the suffixes "m" and "u" between the executable, library, and include directory. --- Modules/FindPythonLibs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index 127662d6b..1c8776bac 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -154,7 +154,7 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS}) if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR) foreach(dir ${Python_FRAMEWORKS}) list(APPEND PYTHON_FRAMEWORK_INCLUDES - ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION}) + ${dir}/Versions/${_CURRENT_VERSION}/include) endforeach() endif()