From 629bd7cdeff082ab00508e77e5ca5bdd2f3c011d Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Sun, 19 Jul 2026 09:35:42 +0000 Subject: [PATCH] Add SQLite3::SQLite3 compat alias, use modern target name CMake's bundled FindSQLite3 module only creates the SQLite3::SQLite3 target since CMake 4.3; earlier versions (still used by most current Linux distros) only provide SQLite::SQLite3, which CMake >= 4.3 now flags as deprecated. Add the missing alias ourselves right after find_package(SQLite3) when it isn't already provided, so the project can link against the modern SQLite3::SQLite3 name on every supported CMake version without triggering the deprecation warning on newer ones. --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c23dafa6..c73153fcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,16 @@ endif() find_package(SQLite3 REQUIRED) +# CMake < 4.3 only creates the SQLite::SQLite3 target (no SQLite3::SQLite3 +# alias yet), while CMake >= 4.3's bundled FindSQLite3 creates SQLite3::SQLite3 +# and deprecates the old name. Add the missing alias ourselves so we can use +# the modern target name everywhere regardless of the CMake version in use +# (this project must keep building on CMake versions below 4.3, e.g. on most +# current Linux distros). +if(NOT TARGET SQLite3::SQLite3 AND TARGET SQLite::SQLite3) + add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3) +endif() + set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui) # The default build only compiles the tracked .ts files to .qm (lrelease). @@ -141,7 +151,7 @@ target_link_libraries( PRIVATE pugixml::pugixml SingleApplication::SingleApplication - SQLite::SQLite3 + SQLite3::SQLite3 ${KF5_PRIVATE_LIBRARIES} ${QET_PRIVATE_LIBRARIES} )