improvements to libdecor support in cmake

this makes it consistent with wayland support, and makes cmake side
in line with autotools' libdecor support.
This commit is contained in:
Ozkan Sezer
2021-08-03 14:01:02 +03:00
parent a15ec36547
commit 5b18ae29b7
3 changed files with 16 additions and 10 deletions

View File

@@ -701,9 +701,20 @@ macro(CheckWayland)
pkg_check_modules(LIBDECOR libdecor-0)
if(LIBDECOR_FOUND)
set(HAVE_WAYLAND_LIBDECOR TRUE)
FindLibraryAndSONAME(decor-0)
set(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR "\"${DECOR_0_LIB_SONAME}\"")
add_definitions(-DHAVE_LIBDECOR_H)
set(HAVE_LIBDECOR_H 1)
link_directories(${LIBDECOR_LIBRARY_DIRS})
include_directories(${LIBDECOR_INCLUDE_DIRS})
if(LIBDECOR_SHARED)
if(NOT HAVE_DLOPEN)
message_warn("You must have SDL_LoadObject() support for dynamic libdecor loading")
else()
set(HAVE_LIBDECOR_SHARED TRUE)
FindLibraryAndSONAME(decor-0)
set(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR "\"${DECOR_0_LIB_SONAME}\"")
endif()
else()
set(EXTRA_LIBS ${LIBDECOR_LIBRARIES} ${EXTRA_LIBS})
endif()
endif()
endif()