Revert the last two CMake changes.

get_filename_component returns "/regstry" if the query is unsuccessful.
We'll have to add a check for that if we query "Add Paths".

Revert "CMake: Pass ABSOLUTE to get_filename_component."

This reverts commit 4c03f4be00.

Revert "CMake: Look for Python using the "App Paths" key."

This reverts commit 6d1b6cd39d.

Change-Id: Ida17608467fa3652f4219e4eaf01edfa48120b1d
Reviewed-on: https://code.wireshark.org/review/11512
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2015-11-02 17:28:42 -08:00
parent 4c03f4be00
commit 5c5cc228fc
1 changed files with 13 additions and 28 deletions

View File

@ -2,32 +2,17 @@
# calling FindPythonInterp in order to keep us from using Cygwin's Python.
# http://public.kitware.com/Bug/view.php?id=13818
if(WIN32)
# First check the HKLM and HKCU "App Paths" keys.
if(NOT PYTHON_EXECUTABLE)
get_filename_component(PYTHON_EXECUTABLE
"[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Python.exe]"
ABSOLUTE CACHE
)
endif()
if(NOT PYTHON_EXECUTABLE)
get_filename_component(PYTHON_EXECUTABLE
"[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Python.exe]"
ABSOLUTE CACHE
)
endif()
if(NOT PYTHON_EXECUTABLE)
foreach(_major_version 3 2)
foreach(_minor_version 7 6 5 4 3 2 1)
find_program(PYTHON_EXECUTABLE
python.exe
PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_major_version}.${_minor_version}\\InstallPath]
NO_DEFAULT_PATH
)
if (PYTHON_EXECUTABLE)
break()
endif()
endforeach()
if(NOT PYTHON_EXECUTABLE AND WIN32)
foreach(_major_version 3 2)
foreach(_minor_version 7 6 5 4 3 2 1)
find_program(PYTHON_EXECUTABLE
python.exe
PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_major_version}.${_minor_version}\\InstallPath]
NO_DEFAULT_PATH
)
if (PYTHON_EXECUTABLE)
break()
endif()
endforeach()
endif()
endif(WIN32)
endforeach()
endif()