cmake: Correct gbm version check

It appears like gbm_VERSION can be a list, which if() does not like. So
pass the variable to the if() rather than its value. While on this, also
change GREATER_EQUAL to VERSION_GREATER_EQUAL so cmake compares
individual version components.
This commit is contained in:
Vlad Zahorodnii 2023-05-03 15:07:37 +03:00
parent 1e848ac302
commit 70d76791d8

View file

@ -236,12 +236,12 @@ set_package_properties(Libdrm PROPERTIES TYPE REQUIRED PURPOSE "Required for drm
find_package(gbm)
set_package_properties(gbm PROPERTIES TYPE REQUIRED PURPOSE "Required for egl output of drm backend.")
if (${gbm_VERSION} GREATER_EQUAL 21.1)
if (gbm_VERSION VERSION_GREATER_EQUAL 21.1)
set(HAVE_GBM_BO_GET_FD_FOR_PLANE 1)
else()
set(HAVE_GBM_BO_GET_FD_FOR_PLANE 0)
endif()
if (${gbm_VERSION} GREATER_EQUAL 21.3)
if (gbm_VERSION VERSION_GREATER_EQUAL 21.3)
set(HAVE_GBM_BO_CREATE_WITH_MODIFIERS2 1)
else()
set(HAVE_GBM_BO_CREATE_WITH_MODIFIERS2 0)