cmake v2.8.11 does not support VERSION_GREATER_EQUAL; use VERSION_GREATER and VERSION_EQUAL instead
@@ -866,13 +866,14 @@ IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
EXECUTE_PROCESS(
COMMAND uname -r
- OUTPUT_VARIABLE UNAME_R
+ OUTPUT_VARIABLE KERNEL_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
- IF (UNAME_R VERSION_GREATER_EQUAL "4.9.0")
+ SET(REQUIRED_KERNEL_VERSION "4.9.0")
+ IF (KERNEL_VERSION VERSION_GREATER REQUIRED_KERNEL_VERSION OR KERNEL_VERSION VERSION_EQUAL REQUIRED_KERNEL_VERSION)
SET(HAVE_BPF_SUPPORTED_KERNEL ON)
- MESSAGE(STATUS "Checking Linux kernel version >= 4.9.0 for h2olog - OK")
+ MESSAGE(STATUS "Checking Linux kernel version ${KERNEL_VERSION} >= ${REQUIRED_KERNEL_VERSION} for h2olog - OK")
ENDIF ()
ENDIF ()
