summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/modules/LocatePythonExecutable.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/cmake/modules/LocatePythonExecutable.cmake b/cmake/modules/LocatePythonExecutable.cmake
index 3d48861a9c..2f77fbdc0d 100644
--- a/cmake/modules/LocatePythonExecutable.cmake
+++ b/cmake/modules/LocatePythonExecutable.cmake
@@ -5,14 +5,17 @@
if(NOT PYTHON_EXECUTABLE AND WIN32)
foreach(_major_version 3 2)
foreach(_minor_version 7 6 5 4 3 2 1)
+ if (PYTHON_EXECUTABLE)
+ break()
+ endif()
find_program(PYTHON_EXECUTABLE
python.exe
- PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_major_version}.${_minor_version}\\InstallPath]
+ PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_major_version}.${_minor_version}\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_major_version}.${_minor_version}-32\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_major_version}.${_minor_version}-64\\InstallPath]
NO_DEFAULT_PATH
)
- if (PYTHON_EXECUTABLE)
- break()
- endif()
endforeach()
endforeach()
endif()