From 398c0fdff0946ddb87853a474be286d3c01b89ca Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sat, 18 Dec 2021 23:56:10 +0300 Subject: [PATCH] cmake: simplify wayland-scanner 1.15 detection. --- cmake/sdlchecks.cmake | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index b472a598c..d23d4b8b9 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -646,19 +646,11 @@ macro(CheckWayland) endif() string(REPLACE "wayland-scanner " "" WAYLAND_SCANNER_VERSION ${WAYLAND_SCANNER_VERSION}) - if(CMAKE_VERSION VERSION_LESS 3.7.0) - string(COMPARE LESS ${WAYLAND_SCANNER_VERSION} "1.15.0" WAYLAND_SCANNER_1_15_NOTFOUND) - if(NOT WAYLAND_SCANNER_1_15_NOTFOUND) - set(WAYLAND_SCANNER_1_15_FOUND TRUE) - endif() - else() - string(COMPARE GREATER_EQUAL ${WAYLAND_SCANNER_VERSION} "1.15.0" WAYLAND_SCANNER_1_15_FOUND) - endif() - - if(WAYLAND_SCANNER_1_15_FOUND) - set(WAYLAND_SCANNER_CODE_MODE "private-code") - else() + string(COMPARE LESS ${WAYLAND_SCANNER_VERSION} "1.15.0" WAYLAND_SCANNER_PRE_1_15) + if(WAYLAND_SCANNER_PRE_1_15) set(WAYLAND_SCANNER_CODE_MODE "code") + else() + set(WAYLAND_SCANNER_CODE_MODE "private-code") endif() endif()