summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorRye <rye@lindenlab.com>2024-11-01 01:45:11 -0400
committerGitHub <noreply@github.com>2024-11-01 01:45:11 -0400
commitc3590fd827e65cc127a82735ad856f5dff0f3af4 (patch)
treef9235de8dde0b8fc6b5b68fdf969157fd46da890 /indra/cmake
parent6aa18dc532f6b56dd9b6872553fa9ecb3bf0ca55 (diff)
parent058711f2a0c3f6dfd66de342338c930ec303e517 (diff)
Merge pull request #2918 from RyeMutt/rye/nfde
Introduce NativeFileDialog-Extended filepickers for Linux
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/CMakeLists.txt1
-rw-r--r--indra/cmake/LLWindow.cmake2
-rw-r--r--indra/cmake/NFDE.cmake42
-rw-r--r--indra/cmake/SDL2.cmake7
4 files changed, 46 insertions, 6 deletions
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index 9017fc2fb4..9d95a23a59 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -43,6 +43,7 @@ set(cmake_SOURCE_FILES
Lualibs.cmake
Meshoptimizer.cmake
NDOF.cmake
+ NFDE.cmake
OPENAL.cmake
OpenGL.cmake
OpenJPEG.cmake
diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake
index a5791f1bef..3bdca544ac 100644
--- a/indra/cmake/LLWindow.cmake
+++ b/indra/cmake/LLWindow.cmake
@@ -9,5 +9,5 @@ include_guard()
if (LINUX)
# linux uses SDL2 for window and keyboard
- target_compile_definitions( ll::SDL2 INTERFACE LL_USE_SDL_KEYBOARD=1 )
+ target_compile_definitions( ll::SDL2 INTERFACE LL_USE_SDL_WINDOW=1 LL_USE_SDL_KEYBOARD=1 )
endif (LINUX)
diff --git a/indra/cmake/NFDE.cmake b/indra/cmake/NFDE.cmake
new file mode 100644
index 0000000000..196ba575b2
--- /dev/null
+++ b/indra/cmake/NFDE.cmake
@@ -0,0 +1,42 @@
+# -*- cmake -*-
+if(LINUX)
+ set(USE_NFDE ON CACHE BOOL "Use Native File Dialog wrapper library")
+ set(USE_NFDE_PORTAL ON CACHE BOOL "Use NFDE XDG Portals")
+endif()
+
+include_guard()
+
+add_library(ll::nfde INTERFACE IMPORTED)
+if(USE_NFDE)
+ include(Prebuilt)
+ use_prebuilt_binary(nfde)
+
+ target_compile_definitions( ll::nfde INTERFACE LL_NFD=1)
+
+ if (WINDOWS)
+ target_link_libraries( ll::nfde INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/nfd.lib)
+ elseif (DARWIN)
+ target_link_libraries( ll::nfde INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libnfd.a)
+ elseif (LINUX)
+ if(USE_NFDE_PORTAL)
+ target_link_libraries( ll::nfde INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libnfd_portal.a)
+ else()
+ target_link_libraries( ll::nfde INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libnfd_gtk.a)
+ endif()
+ endif ()
+
+ if (LINUX)
+ find_package(PkgConfig REQUIRED)
+ if(NOT USE_NFDE_PORTAL)
+ pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
+ target_link_libraries(ll::nfde INTERFACE ${GTK3_LINK_LIBRARIES})
+ else()
+ pkg_check_modules(DBUS REQUIRED dbus-1)
+ target_link_libraries(ll::nfde INTERFACE ${DBUS_LINK_LIBRARIES})
+ endif()
+ endif()
+
+ target_include_directories( ll::nfde SYSTEM INTERFACE
+ ${LIBS_PREBUILT_DIR}/include/nfde
+ )
+endif()
diff --git a/indra/cmake/SDL2.cmake b/indra/cmake/SDL2.cmake
index 87195ed108..a464133f3f 100644
--- a/indra/cmake/SDL2.cmake
+++ b/indra/cmake/SDL2.cmake
@@ -12,11 +12,8 @@ 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()
+ PATHS "${LIBS_PREBUILT_DIR}/lib/release" REQUIRED)
target_link_libraries( ll::SDL2 INTERFACE "${SDL2_LIBRARY}" )
-target_include_directories( ll::SDL2 SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include" )
+target_include_directories( ll::SDL2 SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/SDL2" )