summaryrefslogtreecommitdiff
path: root/indra/cmake/SDL2.cmake
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-10-08 18:31:52 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-10-08 18:31:52 +0300
commitb16ede862f3e1414eee044c5a2b49017706af943 (patch)
tree5e223816b20f02185a487224d8dcc0dbf406142d /indra/cmake/SDL2.cmake
parenta301fb2876835f799317f8a011f368eaec4894d6 (diff)
parenta43b2106853b516248a2e657a28084b7d906cf5f (diff)
Merge branch 'develop' into marchcat/xcode-16
# Conflicts: # .github/workflows/build.yaml # indra/llmath/raytrace.cpp
Diffstat (limited to 'indra/cmake/SDL2.cmake')
-rw-r--r--indra/cmake/SDL2.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/cmake/SDL2.cmake b/indra/cmake/SDL2.cmake
new file mode 100644
index 0000000000..87195ed108
--- /dev/null
+++ b/indra/cmake/SDL2.cmake
@@ -0,0 +1,22 @@
+# -*- cmake -*-
+cmake_minimum_required( VERSION 3.13 FATAL_ERROR )
+
+include(Linking)
+include( Prebuilt )
+include_guard()
+
+add_library( ll::SDL2 INTERFACE IMPORTED )
+
+use_system_binary( SDL2 )
+use_prebuilt_binary( SDL2 )
+
+find_library( SDL2_LIBRARY
+ NAMES SDL2
+ PATHS "${LIBS_PREBUILT_DIR}/lib/release")
+if ( "${SDL2_LIBRARY}" STREQUAL "SDL2_LIBRARY-NOTFOUND" )
+ message( FATAL_ERROR "unable to find SDL2_LIBRARY" )
+endif()
+
+target_link_libraries( ll::SDL2 INTERFACE "${SDL2_LIBRARY}" )
+target_include_directories( ll::SDL2 SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include" )
+