# SDL: cmake: fix finding wayland-libdecor (beeac)

**URL:** <https://discourse.libsdl.org/t/sdl-cmake-fix-finding-wayland-libdecor-beeac/39541>\
**Category:** SDL Commits\
**Created:** [October 24, 2022, 5:38pm UTC](https://discourse.libsdl.org/t/sdl-cmake-fix-finding-wayland-libdecor-beeac/39541 "2022-10-24T17:38:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [October 24, 2022, 5:38pm UTC](https://discourse.libsdl.org/t/sdl-cmake-fix-finding-wayland-libdecor-beeac/39541/1 "2022-10-24T17:38:40Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/beeac6022745653339e1223018d0abf25ea99a0c>
>
> It was broken in 11d53c84a7663d5a5861f3672990ca4b32376e3e
> (cherry-picked from co…mmit 0823b5973a28ebad2ca6d34058c12602bc8a69f0)

```diff
From beeac6022745653339e1223018d0abf25ea99a0c Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 21 Oct 2022 15:31:43 +0200
Subject: [PATCH] cmake: fix finding wayland-libdecor

It was broken in 11d53c84a7663d5a5861f3672990ca4b32376e3e
(cherry-picked from commit 0823b5973a28ebad2ca6d34058c12602bc8a69f0)
---
 cmake/sdlchecks.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 2b62e413568b..4872def54e2e 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -710,7 +710,7 @@ macro(CheckWayland)
 
       if(SDL_WAYLAND_LIBDECOR)
         pkg_check_modules(PKG_LIBDECOR libdecor-0)
- if(PKG_LIBDECOR)
+ if(PKG_LIBDECOR_FOUND)
             set(HAVE_WAYLAND_LIBDECOR TRUE)
             set(HAVE_LIBDECOR_H 1)
             target_link_directories(sdl-build-options INTERFACE "${PKG_LIBDECOR_LIBRARY_DIRS}")
@@ -720,7 +720,7 @@ macro(CheckWayland)
             endif()
             FindLibraryAndSONAME(decor-0 LIBDIRS ${PKG_LIBDECOR_LIBRARY_DIRS})
             if(SDL_WAYLAND_LIBDECOR_SHARED AND DECOR_0_LIB AND HAVE_SDL_LOADSO)
- set(HAVE_LIBDECOR_SHARED TRUE)
+ set(HAVE_WAYLAND_LIBDECOR_SHARED TRUE)
                 set(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR "\"${DECOR_0_LIB_SONAME}\"")
             else()
               list(APPEND EXTRA_LIBS ${PKG_LIBDECOR_LIBRARIES})

```
