summaryrefslogtreecommitdiff
path: root/indra/cmake/Python.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake/Python.cmake')
-rw-r--r--indra/cmake/Python.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake
index 895b353dbd..0901c1b7a2 100644
--- a/indra/cmake/Python.cmake
+++ b/indra/cmake/Python.cmake
@@ -9,9 +9,14 @@ if (WINDOWS)
NAMES python25.exe python23.exe python.exe
NO_DEFAULT_PATH # added so that cmake does not find cygwin python
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_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
)
elseif (EXISTS /etc/debian_version)
# On Debian and Ubuntu, avoid Python 2.4 if possible.
@@ -21,6 +26,23 @@ elseif (EXISTS /etc/debian_version)
if (PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND ON)
endif (PYTHON_EXECUTABLE)
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ # On MAC OS X be sure to search standard locations first
+
+ string(REPLACE ":" ";" PATH_LIST "$ENV{PATH}")
+ find_program(PYTHON_EXECUTABLE
+ NAMES python python25 python24 python23
+ NO_DEFAULT_PATH # Avoid searching non-standard locations first
+ PATHS
+ /bin
+ /usr/bin
+ /usr/local/bin
+ ${PATH_LIST}
+ )
+
+ if (PYTHON_EXECUTABLE)
+ set(PYTHONINTERP_FOUND ON)
+ endif (PYTHON_EXECUTABLE)
else (WINDOWS)
include(FindPythonInterp)
endif (WINDOWS)