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
This commit is contained in:
Arne Welzel 2023-09-07 11:37:56 +02:00
parent 21562cfbb2
commit 09b7caf986
2 changed files with 2 additions and 2 deletions

View file

@ -735,8 +735,8 @@ if (NOT SED_EXE)
endif () endif ()
endif () endif ()
list(APPEND Python_ADDITIONAL_VERSIONS 3)
set(ZEEK_PYTHON_MIN 3.5.0) set(ZEEK_PYTHON_MIN 3.5.0)
set(Python_FIND_UNVERSIONED_NAMES FIRST)
find_package(Python ${ZEEK_PYTHON_MIN} REQUIRED COMPONENTS Interpreter) find_package(Python ${ZEEK_PYTHON_MIN} REQUIRED COMPONENTS Interpreter)
find_package(FLEX REQUIRED) find_package(FLEX REQUIRED)
find_package(BISON 2.5 REQUIRED) find_package(BISON 2.5 REQUIRED)

2
configure vendored
View file

@ -365,7 +365,7 @@ while [ $# -ne 0 ]; do
append_cache_entry OPENSSL_ROOT_DIR PATH $optarg append_cache_entry OPENSSL_ROOT_DIR PATH $optarg
;; ;;
--with-python=*) --with-python=*)
append_cache_entry PYTHON_EXECUTABLE PATH $optarg append_cache_entry Python_EXECUTABLE PATH $optarg
;; ;;
--with-python-inc=*) --with-python-inc=*)
append_cache_entry PYTHON_INCLUDE_DIR PATH $optarg append_cache_entry PYTHON_INCLUDE_DIR PATH $optarg