Commit 398c0fdff0946ddb87853a474be286d3c01b89ca

Ozkan Sezer 2021-12-18T23:56:10

cmake: simplify wayland-scanner 1.15 detection.

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index b472a59..d23d4b8 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()
+      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()
-        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()
-        set(WAYLAND_SCANNER_CODE_MODE "code")
       endif()
     endif()