Fixed build on CMake older than 3.7

I found this accidentally when I tried to use CMake 3.0 to build this.
This commit is contained in:
Wohlstand 2021-12-18 17:15:08 +03:00 committed by Sam Lantinga
parent 3861afacf5
commit 6c9907dd0e
1 changed files with 10 additions and 1 deletions

View File

@ -646,7 +646,16 @@ macro(CheckWayland)
endif()
string(REPLACE "wayland-scanner " "" WAYLAND_SCANNER_VERSION ${WAYLAND_SCANNER_VERSION})
string(COMPARE GREATER_EQUAL ${WAYLAND_SCANNER_VERSION} "1.15.0" WAYLAND_SCANNER_1_15_FOUND)
if(CMAKE_VERSION VERSION_LESS 3.7.0)
string(COMPARE GREATER ${WAYLAND_SCANNER_VERSION} "1.15.0" WAYLAND_SCANNER_1_15_FOUND_G)
string(COMPARE EQUAL ${WAYLAND_SCANNER_VERSION} "1.15.0" WAYLAND_SCANNER_1_15_FOUND_E)
if(WAYLAND_SCANNER_1_15_FOUND_G OR WAYLAND_SCANNER_1_15_FOUND_E)
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()