From c1be3d08af4664fc64b10d540283a1c511f69438 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Mon, 10 Nov 2025 17:31:20 +0100 Subject: [PATCH] Allow system libktx for Linux client --- CMakeLists.txt | 4 ++++ client/CMakeLists.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60eed16a..7fc61010 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,7 @@ include(GNUInstallDirs) option(WIVRN_USE_SYSTEM_FREETYPE "Use system FreeType" ON) option(WIVRN_USE_SYSTEM_BOOST "Use system Boost headers" ON) option(WIVRN_USE_SYSTEM_OPENXR "Use system OpenXR headers" ON) +option(WIVRN_USE_SYSTEM_LIBKTX "Use system KTX-Software library" ON) option(WIVRN_USE_SYSTEMD "Use libsystemd" ON) option(WIVRN_COMPRESS_GLB "Compress textures in GLB files with gltf-transform" OFF) option(WIVRN_USE_ANDROID_VALIDATION_LAYER "Download the android version of the Vulkan validation layer" OFF) @@ -206,6 +207,9 @@ if (WIVRN_BUILD_CLIENT AND NOT ANDROID) find_package(OpenXR 1.1.48 REQUIRED) endif() + if (WIVRN_USE_SYSTEM_LIBKTX) + find_package(Ktx REQUIRED) + endif() endif() if(ANDROID) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 15e2b8e7..b835bada 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -22,6 +22,7 @@ if(ANDROID AND WIVRN_USE_ANDROID_BIN_LIBKTX) add_library(ktx INTERFACE) target_link_libraries(ktx INTERFACE ${CMAKE_BINARY_DIR}/KTX-Software-${KTX_VERSION}-Android/${ANDROID_ABI}/lib/libktx.so) target_include_directories(ktx INTERFACE ${CMAKE_BINARY_DIR}/KTX-Software-${KTX_VERSION}-Android/${ANDROID_ABI}/include) +elseif(WIVRN_USE_SYSTEM_LIBKTX AND NOT ANDROID) else() FetchContent_MakeAvailable(libktx) endif()