summaryrefslogtreecommitdiff
path: root/indra/cmake/Python.cmake
diff options
context:
space:
mode:
authorBennett Goble <signal@lindenlab.com>2021-06-05 22:02:54 -0700
committerSignal Linden <signal@lindenlab.com>2021-12-10 14:42:49 -0800
commitf729cfc33f258781c5fd85a3d8773bf6149d12db (patch)
treeb4d9e9657f64b1ba46d8522f5c2196acefa3ae77 /indra/cmake/Python.cmake
parentcbaba2df56c66926e051d50b6cb02955c81c2a6c (diff)
SL-15742: Convert build scripts to Python 3
This changeset makes it possible to build the Second Life viewer using Python 3. It is designed to be used with an equivalent Autobuild branch so that a developer can compile without needing Python 2 on their machine. Breaking change: Python 2 support ending Rather than supporting two versions of Python, including one that was discontinued at the beginning of the year, this branch focuses on pouring future effort into Python 3 only. As a result, scripts do not need to be backwards compatible. This means that build environments, be they on personal computers and on build agents, need to have a compatible interpreter. Notes - SLVersionChecker will still use Python 2 on macOS - Fixed the message template url used by template_verifier.py
Diffstat (limited to 'indra/cmake/Python.cmake')
-rw-r--r--indra/cmake/Python.cmake48
1 files changed, 14 insertions, 34 deletions
diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake
index a81c9307fc..ed595f6966 100644
--- a/indra/cmake/Python.cmake
+++ b/indra/cmake/Python.cmake
@@ -6,47 +6,27 @@ if (WINDOWS)
# On Windows, explicitly avoid Cygwin Python.
find_program(PYTHON_EXECUTABLE
- NAMES python25.exe python23.exe python.exe
+ NAMES python.exe
NO_DEFAULT_PATH # added so that cmake does not find cygwin python
PATHS
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
- [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.7\\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.
-
- find_program(PYTHON_EXECUTABLE python PATHS /usr/bin)
-
- 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}
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
)
+ include(FindPythonInterp)
+else()
+ find_program(PYTHON_EXECUTABLE python3)
if (PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND ON)
endif (PYTHON_EXECUTABLE)
-else (WINDOWS)
- include(FindPythonInterp)
endif (WINDOWS)
if (NOT PYTHON_EXECUTABLE)