summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/00-COMPILE-LINK-RUN.txt2
-rw-r--r--indra/cmake/CMakeLists.txt1
-rw-r--r--indra/cmake/Copy3rdPartyLibs.cmake4
-rw-r--r--indra/cmake/LLWindow.cmake13
-rw-r--r--indra/cmake/SDL2.cmake22
-rw-r--r--indra/cmake/UI.cmake3
6 files changed, 33 insertions, 12 deletions
diff --git a/indra/cmake/00-COMPILE-LINK-RUN.txt b/indra/cmake/00-COMPILE-LINK-RUN.txt
index 1933072a6d..6cff0c0f28 100644
--- a/indra/cmake/00-COMPILE-LINK-RUN.txt
+++ b/indra/cmake/00-COMPILE-LINK-RUN.txt
@@ -162,7 +162,7 @@ Linking
* Update the autobuild.xml of ALL consumers of the library. In
the case of zlib, that meant updating freetype, libpng, openssl,
- libxml2, fontconfig, curl, Boost, SDL, llqtwebkit, google-mock and
+ libxml2, fontconfig, curl, Boost, SDL2, llqtwebkit, google-mock and
colladadom.
* Confirm by test and observation that the consumers actually use
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index 16da388e61..9017fc2fb4 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -52,6 +52,7 @@ set(cmake_SOURCE_FILES
Prebuilt.cmake
PulseAudio.cmake
Python.cmake
+ SDL2.cmake
TemplateCheck.cmake
TinyEXR.cmake
TinyGLTF.cmake
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 1e6dabd6c0..e98c77497b 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -54,6 +54,7 @@ if(WINDOWS)
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(release_files
openjp2.dll
+ SDL2.dll
)
if(LLCOMMON_LINK_SHARED)
@@ -169,6 +170,8 @@ elseif(DARWIN)
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(release_files
libndofdev.dylib
+ libSDL2.dylib
+ libSDL2-2.0.dylib
)
if(LLCOMMON_LINK_SHARED)
@@ -197,6 +200,7 @@ elseif(LINUX)
libortp.so
libvivoxoal.so.1
libvivoxsdk.so
+ libSDL2.so
)
set(slvoice_files SLVoice)
diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake
index 23f4115aeb..a5791f1bef 100644
--- a/indra/cmake/LLWindow.cmake
+++ b/indra/cmake/LLWindow.cmake
@@ -3,18 +3,11 @@
include(Variables)
include(GLEXT)
include(Prebuilt)
+include(SDL2)
include_guard()
-add_library( ll::SDL INTERFACE IMPORTED )
-
if (LINUX)
- #Must come first as use_system_binary can exit this file early
- target_compile_definitions( ll::SDL INTERFACE LL_SDL_VERSION=2 LL_SDL)
-
- #find_package(SDL2 REQUIRED)
- #target_link_libraries( ll::SDL INTERFACE SDL2::SDL2 SDL2::SDL2main X11)
-
- use_prebuilt_binary(SDL2)
- target_link_libraries( ll::SDL INTERFACE SDL2 X11)
+ # linux uses SDL2 for window and keyboard
+ target_compile_definitions( ll::SDL2 INTERFACE LL_USE_SDL_KEYBOARD=1 )
endif (LINUX)
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" )
+
diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake
index 0df62808e7..ae039b4a47 100644
--- a/indra/cmake/UI.cmake
+++ b/indra/cmake/UI.cmake
@@ -21,9 +21,10 @@ if (LINUX)
Xext
Xft
Xinerama
+ X11
ll::fontconfig
ll::freetype
- ll::SDL
+ ll::SDL2
ll::glib
ll::gio
)