aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-11-02 17:28:42 -0800
committerGerald Combs <gerald@wireshark.org>2015-11-03 01:35:28 +0000
commit5c5cc228fc84fe2efc7528a783d1f825c396bfb2 (patch)
tree87baf4a62d4d85c3731a4af67b0c1245e877e6f9
parent4c03f4be000fd930a939b042e8d1b68c509ccebd (diff)
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 4c03f4be000fd930a939b042e8d1b68c509ccebd. Revert "CMake: Look for Python using the "App Paths" key." This reverts commit 6d1b6cd39db80fe8dc77c250ae795d16ce08bf41. Change-Id: Ida17608467fa3652f4219e4eaf01edfa48120b1d Reviewed-on: https://code.wireshark.org/review/11512 Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--cmake/modules/LocatePythonExecutable.cmake41
1 files changed, 13 insertions, 28 deletions
diff --git a/cmake/modules/LocatePythonExecutable.cmake b/cmake/modules/LocatePythonExecutable.cmake
index e1d7eeba3f..125ed5fff5 100644
--- a/cmake/modules/LocatePythonExecutable.cmake
+++ b/cmake/modules/LocatePythonExecutable.cmake
@@ -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) \ No newline at end of file
+ endforeach()
+endif() \ No newline at end of file