2012-11-11 12:13:31 -05:00
|
|
|
$OpenBSD: patch-Modules_FindPythonLibs_cmake,v 1.7 2012/11/11 17:13:31 dcoppa Exp $
|
|
|
|
--- Modules/FindPythonLibs.cmake.orig Fri Nov 2 10:56:12 2012
|
|
|
|
+++ Modules/FindPythonLibs.cmake Fri Nov 2 11:04:28 2012
|
|
|
|
@@ -36,6 +36,9 @@ include(CMakeFindFrameworks)
|
2010-05-28 16:21:48 -04:00
|
|
|
# Search for the python framework on Apple.
|
|
|
|
CMAKE_FIND_FRAMEWORKS(Python)
|
|
|
|
|
2012-11-11 12:13:31 -05:00
|
|
|
+set(MODPY_VERSION $ENV{MODPY_VERSION})
|
|
|
|
+set(MODPY_INCDIR $ENV{MODPY_INCDIR})
|
2010-05-28 16:21:48 -04:00
|
|
|
+
|
2012-11-11 12:13:31 -05:00
|
|
|
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.3 3.2 3.1 3.0)
|
|
|
|
@@ -69,10 +72,14 @@ endif()
|
2012-05-07 03:06:20 -04:00
|
|
|
|
2011-03-13 14:23:01 -04:00
|
|
|
# Set up the versions we know about, in the order we will search. Always add
|
|
|
|
# the user supplied additional versions to the front.
|
2012-11-11 12:13:31 -05:00
|
|
|
-set(_Python_VERSIONS
|
2011-03-13 14:23:01 -04:00
|
|
|
- ${Python_ADDITIONAL_VERSIONS}
|
2012-05-07 03:06:20 -04:00
|
|
|
- ${_PYTHON_FIND_OTHER_VERSIONS}
|
|
|
|
- )
|
2012-11-11 12:13:31 -05:00
|
|
|
+if(MODPY_VERSION)
|
|
|
|
+ set(_Python_VERSIONS ${MODPY_VERSION})
|
|
|
|
+else(MODPY_VERSION)
|
|
|
|
+ set(_Python_VERSIONS
|
2011-03-13 14:23:01 -04:00
|
|
|
+ ${Python_ADDITIONAL_VERSIONS}
|
2012-05-07 03:06:20 -04:00
|
|
|
+ ${_PYTHON_FIND_OTHER_VERSIONS}
|
|
|
|
+ )
|
2012-11-11 12:13:31 -05:00
|
|
|
+endif(MODPY_VERSION)
|
2011-03-13 14:23:01 -04:00
|
|
|
|
2012-11-11 12:13:31 -05:00
|
|
|
unset(_PYTHON_FIND_OTHER_VERSIONS)
|
|
|
|
unset(_PYTHON1_VERSIONS)
|
|
|
|
@@ -129,18 +136,22 @@ foreach(_CURRENT_VERSION ${_Python_VERSIONS})
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2010-05-28 16:21:48 -04:00
|
|
|
|
2012-11-11 12:13:31 -05:00
|
|
|
- find_path(PYTHON_INCLUDE_DIR
|
2010-05-28 16:21:48 -04:00
|
|
|
- NAMES Python.h
|
|
|
|
- PATHS
|
|
|
|
- ${PYTHON_FRAMEWORK_INCLUDES}
|
|
|
|
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
|
2012-05-07 03:06:20 -04:00
|
|
|
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
|
2010-05-28 16:21:48 -04:00
|
|
|
- PATH_SUFFIXES
|
2012-08-31 08:28:31 -04:00
|
|
|
- python${_CURRENT_VERSION}mu
|
|
|
|
- python${_CURRENT_VERSION}m
|
|
|
|
- python${_CURRENT_VERSION}u
|
2010-05-28 16:21:48 -04:00
|
|
|
- python${_CURRENT_VERSION}
|
|
|
|
- )
|
2012-11-11 12:13:31 -05:00
|
|
|
+ if(MODPY_VERSION AND MODPY_INCDIR)
|
|
|
|
+ set(PYTHON_INCLUDE_DIR "${MODPY_INCDIR}")
|
|
|
|
+ else(MODPY_VERSION AND MODPY_INCDIR)
|
|
|
|
+ find_path(PYTHON_INCLUDE_DIR
|
2010-05-28 16:21:48 -04:00
|
|
|
+ NAMES Python.h
|
|
|
|
+ PATHS
|
|
|
|
+ ${PYTHON_FRAMEWORK_INCLUDES}
|
|
|
|
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
|
2012-05-07 03:06:20 -04:00
|
|
|
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
|
2010-05-28 16:21:48 -04:00
|
|
|
+ PATH_SUFFIXES
|
2012-08-31 08:28:31 -04:00
|
|
|
+ python${_CURRENT_VERSION}mu
|
|
|
|
+ python${_CURRENT_VERSION}m
|
|
|
|
+ python${_CURRENT_VERSION}u
|
2010-05-28 16:21:48 -04:00
|
|
|
+ python${_CURRENT_VERSION}
|
|
|
|
+ )
|
2012-11-11 12:13:31 -05:00
|
|
|
+ endif(MODPY_VERSION AND MODPY_INCDIR)
|
2010-05-28 16:21:48 -04:00
|
|
|
|
2012-08-31 08:28:31 -04:00
|
|
|
# For backward compatibility, set PYTHON_INCLUDE_PATH.
|
2012-11-11 12:13:31 -05:00
|
|
|
set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
|