SDL: cmake: fix finding wayland-libdecor

From 0823b5973a28ebad2ca6d34058c12602bc8a69f0 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
---
 cmake/sdlchecks.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 090852dd79d5..8a19e5b60b3a 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -699,7 +699,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}")
@@ -709,7 +709,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})