From afa631ab416139580771a159a350893208546b20 Mon Sep 17 00:00:00 2001 From: pi03k Date: Sat, 21 Mar 2026 11:31:35 +0100 Subject: [PATCH] Use non deprecated dependency name for sqlite lib (#8639) Works for both versions of lib - system found and fetched from git. --- components/CMakeLists.txt | 9 +++++++-- extern/CMakeLists.txt | 4 +--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 0d1fe76ad1..a2131b8bf8 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -577,7 +577,12 @@ endif() include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) -find_package(SQLite3 REQUIRED) +if (OPENMW_USE_SYSTEM_SQLITE3) + find_package(SQLite3 REQUIRED) + if(NOT TARGET SQLite3::SQLite3) # CMake < 4.3 + add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3) + endif() +endif() add_library(components STATIC ${COMPONENT_FILES}) @@ -621,7 +626,7 @@ target_link_libraries(components RecastNavigation::Recast Base64 - SQLite::SQLite3 + SQLite3::SQLite3 smhasher ${ICU_LIBRARIES} ZLIB::ZLIB diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index e8464ab66a..3dc1050d90 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -182,10 +182,8 @@ if (NOT OPENMW_USE_SYSTEM_SQLITE3) if (UNIX) target_link_libraries(sqlite3 ${CMAKE_DL_LIBS}) endif() - add_library(SQLite::SQLite3 ALIAS sqlite3) - set(SQLite3_INCLUDE_DIR ${sqlite3_SOURCE_DIR}/ PARENT_SCOPE) - set(SQLite3_LIBRARY sqlite3 PARENT_SCOPE) + add_library(SQLite3::SQLite3 ALIAS sqlite3) endif() add_subdirectory(smhasher)