cmake: simplify wayland-scanner 1.15 detection.

This commit is contained in:
Ozkan Sezer 2021-12-18 23:56:10 +03:00
parent 54d2451069
commit 398c0fdff0
1 changed files with 4 additions and 12 deletions

View File

@ -646,19 +646,11 @@ macro(CheckWayland)
endif() endif()
string(REPLACE "wayland-scanner " "" WAYLAND_SCANNER_VERSION ${WAYLAND_SCANNER_VERSION}) 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_PRE_1_15)
string(COMPARE LESS ${WAYLAND_SCANNER_VERSION} "1.15.0" WAYLAND_SCANNER_1_15_NOTFOUND) if(WAYLAND_SCANNER_PRE_1_15)
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()
set(WAYLAND_SCANNER_CODE_MODE "code") set(WAYLAND_SCANNER_CODE_MODE "code")
else()
set(WAYLAND_SCANNER_CODE_MODE "private-code")
endif() endif()
endif() endif()