From eeec219a66ed89235093fb63753d6baf6c21de78 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 24 Nov 2020 20:23:05 -0800 Subject: [PATCH] Update CMake logic to enforce Python >= 3.5 --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b92e39201..e8ce79519d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -236,6 +236,7 @@ if (NOT SED_EXE) endif () endif () +list(APPEND Python_ADDITIONAL_VERSIONS 3) FindRequiredPackage(PythonInterp) FindRequiredPackage(FLEX) FindRequiredPackage(BISON) @@ -282,6 +283,12 @@ if (MISSING_PREREQS) message(FATAL_ERROR "Configuration aborted due to missing prerequisites") endif () +set(ZEEK_PYTHON_MIN 3.5.0) + +if ( PYTHON_VERSION_STRING VERSION_LESS ${ZEEK_PYTHON_MIN} ) + message(FATAL_ERROR "Python ${ZEEK_PYTHON_MIN} or greater is required.") +endif () + if ( CAF_ROOT_DIR ) find_package(CAF COMPONENTS core io openssl REQUIRED) endif () @@ -530,7 +537,7 @@ endif () if (INSTALL_ZEEKCTL) # CPack RPM Generator may not automatically detect this - set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.6.0") + set(CPACK_RPM_PACKAGE_REQUIRES "python >= ${ZEEK_PYTHON_MIN}") endif () # If this CMake project is a sub-project of another, we will not