From a6bedb9bb8dd9288eb690c79186d581d07e5b1d7 Mon Sep 17 00:00:00 2001
From: Ryan Pavlik <ryan.pavlik@collabora.com>
Date: Fri, 20 Nov 2020 10:09:55 -0600
Subject: [PATCH] cmake: Handle SDL2 static builds

---
 CMakeLists.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c4133e01..5c3a610b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -204,9 +204,12 @@ if(XRT_HAVE_OPENGLES AND NOT XRT_HAVE_EGL)
 endif()
 
 if(XRT_HAVE_SDL2)
-	# Arch work around
 	if(NOT DEFINED SDL2_LIBRARIES)
-		set(SDL2_LIBRARIES SDL2::SDL2)
+		if(TARGET SDL2::SDL2-static)
+			set(SDL2_LIBRARIES SDL2::SDL2-static)
+		elseif(TARGET SDL2::SDL2)
+			set(SDL2_LIBRARIES SDL2::SDL2)
+		endif()
 	endif()
 endif()