d475b0a293
"There was no cmake fallout in the bulk on amd64" jasper@ Also tested by Brad with a handful of CMake using ports
68 lines
2.4 KiB
Plaintext
68 lines
2.4 KiB
Plaintext
$OpenBSD: patch-Modules_FindPythonLibs_cmake,v 1.6 2012/08/31 12:28:31 dcoppa Exp $
|
|
--- Modules/FindPythonLibs.cmake.orig Thu Aug 23 11:39:18 2012
|
|
+++ Modules/FindPythonLibs.cmake Thu Aug 23 11:42:40 2012
|
|
@@ -36,6 +36,9 @@ INCLUDE(CMakeFindFrameworks)
|
|
# Search for the python framework on Apple.
|
|
CMAKE_FIND_FRAMEWORKS(Python)
|
|
|
|
+SET(MODPY_VERSION $ENV{MODPY_VERSION})
|
|
+SET(MODPY_INCDIR $ENV{MODPY_INCDIR})
|
|
+
|
|
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(PythonLibs_FIND_VERSION)
|
|
|
|
# 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}
|
|
- )
|
|
+IF(MODPY_VERSION)
|
|
+ SET(_Python_VERSIONS ${MODPY_VERSION})
|
|
+ELSE(MODPY_VERSION)
|
|
+ SET(_Python_VERSIONS
|
|
+ ${Python_ADDITIONAL_VERSIONS}
|
|
+ ${_PYTHON_FIND_OTHER_VERSIONS}
|
|
+ )
|
|
+ENDIF(MODPY_VERSION)
|
|
|
|
UNSET(_PYTHON_FIND_OTHER_VERSIONS)
|
|
UNSET(_PYTHON1_VERSIONS)
|
|
@@ -129,18 +136,22 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
|
|
ENDFOREACH(dir)
|
|
ENDIF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
|
|
|
|
- FIND_PATH(PYTHON_INCLUDE_DIR
|
|
- NAMES Python.h
|
|
- PATHS
|
|
- ${PYTHON_FRAMEWORK_INCLUDES}
|
|
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
|
|
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
|
|
- PATH_SUFFIXES
|
|
- python${_CURRENT_VERSION}mu
|
|
- python${_CURRENT_VERSION}m
|
|
- python${_CURRENT_VERSION}u
|
|
- python${_CURRENT_VERSION}
|
|
- )
|
|
+ IF(MODPY_VERSION AND MODPY_INCDIR)
|
|
+ SET(PYTHON_INCLUDE_DIR "${MODPY_INCDIR}")
|
|
+ ELSE(MODPY_VERSION AND MODPY_INCDIR)
|
|
+ FIND_PATH(PYTHON_INCLUDE_DIR
|
|
+ NAMES Python.h
|
|
+ PATHS
|
|
+ ${PYTHON_FRAMEWORK_INCLUDES}
|
|
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
|
|
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
|
|
+ PATH_SUFFIXES
|
|
+ python${_CURRENT_VERSION}mu
|
|
+ python${_CURRENT_VERSION}m
|
|
+ python${_CURRENT_VERSION}u
|
|
+ python${_CURRENT_VERSION}
|
|
+ )
|
|
+ ENDIF(MODPY_VERSION AND MODPY_INCDIR)
|
|
|
|
# For backward compatibility, set PYTHON_INCLUDE_PATH.
|
|
SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
|