Annotation of /trunk/linden/indra/cmake/Python.cmake
Parent Directory
|
Revision Log
Revision 103 - (view) (download)
| 1 : | mjm | 57 | # -*- cmake -*- |
| 2 : | |||
| 3 : | set(PYTHONINTERP_FOUND) | ||
| 4 : | |||
| 5 : | if (WINDOWS) | ||
| 6 : | # On Windows, explicitly avoid Cygwin Python. | ||
| 7 : | |||
| 8 : | find_program(PYTHON_EXECUTABLE | ||
| 9 : | NAMES python25.exe python23.exe python.exe | ||
| 10 : | NO_DEFAULT_PATH # added so that cmake does not find cygwin python | ||
| 11 : | PATHS | ||
| 12 : | mjm | 103 | [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath] |
| 13 : | mjm | 57 | [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath] |
| 14 : | [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] | ||
| 15 : | [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] | ||
| 16 : | ) | ||
| 17 : | elseif (EXISTS /etc/debian_version) | ||
| 18 : | # On Debian and Ubuntu, avoid Python 2.4 if possible. | ||
| 19 : | |||
| 20 : | find_program(PYTHON_EXECUTABLE python2.5 python2.3 python PATHS /usr/bin) | ||
| 21 : | |||
| 22 : | if (PYTHON_EXECUTABLE) | ||
| 23 : | set(PYTHONINTERP_FOUND ON) | ||
| 24 : | endif (PYTHON_EXECUTABLE) | ||
| 25 : | elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
| 26 : | # On MAC OS X be sure to search standard locations first | ||
| 27 : | |||
| 28 : | string(REPLACE ":" ";" PATH_LIST "$ENV{PATH}") | ||
| 29 : | find_program(PYTHON_EXECUTABLE | ||
| 30 : | NAMES python python25 python24 python23 | ||
| 31 : | NO_DEFAULT_PATH # Avoid searching non-standard locations first | ||
| 32 : | PATHS | ||
| 33 : | /bin | ||
| 34 : | /usr/bin | ||
| 35 : | /usr/local/bin | ||
| 36 : | ${PATH_LIST} | ||
| 37 : | ) | ||
| 38 : | |||
| 39 : | if (PYTHON_EXECUTABLE) | ||
| 40 : | set(PYTHONINTERP_FOUND ON) | ||
| 41 : | endif (PYTHON_EXECUTABLE) | ||
| 42 : | else (WINDOWS) | ||
| 43 : | include(FindPythonInterp) | ||
| 44 : | endif (WINDOWS) | ||
| 45 : | |||
| 46 : | if (NOT PYTHON_EXECUTABLE) | ||
| 47 : | message(FATAL_ERROR "No Python interpreter found") | ||
| 48 : | endif (NOT PYTHON_EXECUTABLE) | ||
| 49 : | |||
| 50 : | mark_as_advanced(PYTHON_EXECUTABLE) |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

