From 09b7caf986c4a0747c8ef0da84f80aa18ea75bea Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Thu, 7 Sep 2023 11:37:56 +0200 Subject: [PATCH] configure/CMakelists: Use Python_EXECUTABLE as hint for interpreter The PYTHON_EXECUTABLE variable was only interpreted by our own FindPythonDev. cmake's FindPython uses Python_EXECUTABLE instead. Also, if --with-python is not used, prefer unversioned executables that match the version requirement. Further, remove Python_ADDITIONAL_VERSIONS that is interpreted by FindPythonInterp which we're not using anymore. https://cmake.org/cmake/help/latest/module/FindPython.html#artifacts-specification https://cmake.org/cmake/help/latest/module/FindPythonInterp.html Closes #3275 --- CMakeLists.txt | 2 +- configure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e9c306e19a..8676670790 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -735,8 +735,8 @@ if (NOT SED_EXE) endif () endif () -list(APPEND Python_ADDITIONAL_VERSIONS 3) set(ZEEK_PYTHON_MIN 3.5.0) +set(Python_FIND_UNVERSIONED_NAMES FIRST) find_package(Python ${ZEEK_PYTHON_MIN} REQUIRED COMPONENTS Interpreter) find_package(FLEX REQUIRED) find_package(BISON 2.5 REQUIRED) diff --git a/configure b/configure index 25bde692b6..e74d38280e 100755 --- a/configure +++ b/configure @@ -365,7 +365,7 @@ while [ $# -ne 0 ]; do append_cache_entry OPENSSL_ROOT_DIR PATH $optarg ;; --with-python=*) - append_cache_entry PYTHON_EXECUTABLE PATH $optarg + append_cache_entry Python_EXECUTABLE PATH $optarg ;; --with-python-inc=*) append_cache_entry PYTHON_INCLUDE_DIR PATH $optarg