summaryrefslogtreecommitdiff
path: root/indra/cmake/Python.cmake
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
committerBryan O'Sullivan <bos@lindenlab.com>2008-06-02 21:14:31 +0000
commit9db949eec327df4173fde3de934a87bedb0db13c (patch)
treeaeffa0f0e68b1d2ceb74d460cbbd22652c9cd159 /indra/cmake/Python.cmake
parent419e13d0acaabf5e1e02e9b64a07648bce822b2f (diff)
svn merge -r88066:88786 svn+ssh://svn.lindenlab.com/svn/linden/branches/cmake-9-merge
dataserver-is-deprecated for-fucks-sake-whats-with-these-commit-markers
Diffstat (limited to 'indra/cmake/Python.cmake')
-rw-r--r--indra/cmake/Python.cmake32
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake
new file mode 100644
index 0000000000..895b353dbd
--- /dev/null
+++ b/indra/cmake/Python.cmake
@@ -0,0 +1,32 @@
+# -*- cmake -*-
+
+set(PYTHONINTERP_FOUND)
+
+if (WINDOWS)
+ # On Windows, explicitly avoid Cygwin Python.
+
+ find_program(PYTHON_EXECUTABLE
+ 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.5\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
+ )
+elseif (EXISTS /etc/debian_version)
+ # On Debian and Ubuntu, avoid Python 2.4 if possible.
+
+ find_program(PYTHON_EXECUTABLE python2.5 python2.3 python PATHS /usr/bin)
+
+ if (PYTHON_EXECUTABLE)
+ set(PYTHONINTERP_FOUND ON)
+ endif (PYTHON_EXECUTABLE)
+else (WINDOWS)
+ include(FindPythonInterp)
+endif (WINDOWS)
+
+if (NOT PYTHON_EXECUTABLE)
+ message(FATAL_ERROR "No Python interpreter found")
+endif (NOT PYTHON_EXECUTABLE)
+
+mark_as_advanced(PYTHON_EXECUTABLE)