tags 569321 +patch thanks Hi,
Here are the two patches that do this in a backwards-compatible way (tested here). Best regards, OdyX -- Didier Raboud, proud Debian user. CH-1020 Renens did...@raboud.com
--- /usr/share/cmake-2.8/Modules/FindPythonLibs.cmake 2009-11-13 19:32:52.000000000 +0100 +++ FindPythonLibs.cmake 2010-02-11 14:53:01.000000000 +0100 @@ -27,7 +27,14 @@ # Search for the python framework on Apple. CMAKE_FIND_FRAMEWORKS(Python) -FOREACH(_CURRENT_VERSION 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) +# Allows to choose your python version by setting CMAKE_PYTHON_VERSION to e.g. "2.6" +if (CMAKE_PYTHON_VERSION) + SET(CMAKE_PYTHON_VERSIONS ${CMAKE_PYTHON_VERSION}) +else (CMAKE_PYTHON_VERSION) + SET(CMAKE_PYTHON_VERSIONS 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) +endif (CMAKE_PYTHON_VERSION) + +FOREACH(_CURRENT_VERSION ${CMAKE_PYTHON_VERSIONS}) STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION}) IF(WIN32) FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
--- /usr/share/cmake-2.8/Modules/FindPythonInterp.cmake 2009-11-13 19:32:52.000000000 +0100 +++ FindPythonInterp.cmake 2010-02-11 14:53:01.000000000 +0100 @@ -19,19 +19,20 @@ # (To distributed this file outside of CMake, substitute the full # License text for the above reference.) -FIND_PROGRAM(PYTHON_EXECUTABLE - NAMES python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python +# Allows to choose your python version by setting CMAKE_PYTHON_VERSION to e.g. "2.6" +if (CMAKE_PYTHON_VERSION) + SET(CMAKE_PYTHON_VERSIONS ${CMAKE_PYTHON_VERSION}) +else (CMAKE_PYTHON_VERSION) + SET(CMAKE_PYTHON_VERSIONS 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) +endif (CMAKE_PYTHON_VERSION) + +FOREACH(_CURRENT_VERSION ${CMAKE_PYTHON_VERSIONS}) + FIND_PROGRAM(PYTHON_EXECUTABLE + NAMES python${_CURRENT_VERSION} PATHS - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] ) +ENDFOREACH(_CURRENT_VERSION) # handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if # all listed variables are TRUE
signature.asc
Description: This is a digitally signed message part.