From aa8d462aabe9e38fabe70ac3311f1af41e06f8d4 Mon Sep 17 00:00:00 2001
From: Joseph Walton-Rivers <joseph@walton-rivers.uk>
Date: Thu, 23 Jun 2022 11:55:49 +0100
Subject: [PATCH] try to make sure that ubuntu's openal target works

---
 fggl/audio/openal/CMakeLists.txt | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/fggl/audio/openal/CMakeLists.txt b/fggl/audio/openal/CMakeLists.txt
index df765a0..0e2bc57 100644
--- a/fggl/audio/openal/CMakeLists.txt
+++ b/fggl/audio/openal/CMakeLists.txt
@@ -1,5 +1,14 @@
-find_package( OpenAL CONFIG REQUIRED )
-target_link_libraries( fggl PUBLIC OpenAL::OpenAL )
+find_package( OpenAL CONFIG )
+if ( NOT OpenAL_FOUND )
+    # ubuntu openal-soft package doesn't seem to have a config file
+    find_package( OpenAL REQUIRED )
+endif()
+
+if ( TARGET OpenAL::OpenAL )
+    target_link_libraries( fggl PUBLIC OpenAL::OpenAL )
+else()
+    target_link_libraries( fggl PUBLIC OpenAL )
+endif()
 
 target_sources(fggl
     PRIVATE
-- 
GitLab