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.cmake17
1 files changed, 9 insertions, 8 deletions
diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake
index ed595f6966..5be3cbdf11 100644
--- a/indra/cmake/Python.cmake
+++ b/indra/cmake/Python.cmake
@@ -5,8 +5,8 @@ set(PYTHONINTERP_FOUND)
if (WINDOWS)
# On Windows, explicitly avoid Cygwin Python.
- find_program(PYTHON_EXECUTABLE
- NAMES python.exe
+ find_program(python
+ NAMES python3.exe python.exe
NO_DEFAULT_PATH # added so that cmake does not find cygwin python
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
@@ -18,19 +18,20 @@ if (WINDOWS)
[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]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
)
include(FindPythonInterp)
else()
- find_program(PYTHON_EXECUTABLE python3)
+ find_program(python python3)
- if (PYTHON_EXECUTABLE)
+ if (python)
set(PYTHONINTERP_FOUND ON)
- endif (PYTHON_EXECUTABLE)
+ endif (python)
endif (WINDOWS)
-if (NOT PYTHON_EXECUTABLE)
+if (NOT python)
message(FATAL_ERROR "No Python interpreter found")
-endif (NOT PYTHON_EXECUTABLE)
+endif (NOT python)
+set(PYTHON_EXECUTABLE "${python}" CACHE FILEPATH "Python interpreter for builds")
mark_as_advanced(PYTHON_EXECUTABLE)