summaryrefslogtreecommitdiff
path: root/Modules/FindPythonInterp.cmake
diff options
context:
space:
mode:
authorRobert Dailey <rcdailey@gmail.com>2017-04-07 10:31:12 -0500
committerBrad King <brad.king@kitware.com>2017-04-10 09:47:04 -0400
commit9d15d3c7486ae2d60709617f3fac9ac8bfb289b3 (patch)
treef3c0746ed71a49353fcb9e0469f41f09dc953bd8 /Modules/FindPythonInterp.cmake
parentb8fc447c1df34eeca1d66acd0e17ca743256d6c2 (diff)
downloadcmake-9d15d3c7486ae2d60709617f3fac9ac8bfb289b3.tar.gz
FindPythonInterp: Add `-32` and `-64` registry entry variants
As of 3.6.1 Python (only version tested in this case), installing 32-bit version on 64-bit windows has a slightly different registry key path. `-32` is appended to the end of the version number in the path. Also added a few more registry path guesses based on 64-bit version of Python. Also the module now checks if the host is WIN32 instead of the target, which is required if you are cross compiling.
Diffstat (limited to 'Modules/FindPythonInterp.cmake')
-rw-r--r--Modules/FindPythonInterp.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index f255246123..64b98a8791 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -91,12 +91,15 @@ unset(_PYTHON3_VERSIONS)
if(NOT PYTHON_EXECUTABLE)
foreach(_CURRENT_VERSION IN LISTS _Python_VERSIONS)
set(_Python_NAMES python${_CURRENT_VERSION})
- if(WIN32)
+ if(CMAKE_HOST_WIN32)
list(APPEND _Python_NAMES python)
endif()
find_program(PYTHON_EXECUTABLE
NAMES ${_Python_NAMES}
- PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]
+ PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-32\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}-64\\InstallPath]
)
endforeach()
endif()