cmake: Migrate away from deprecated SQLite3 target

CMake version 4.3 deprecated the imported target `Sqlite::Sqlite3`.
Use the preferred name `Sqlite3::Sqlite3` instead and provide an
alias for older versions of CMake. Also define the same alias when
using vcpkg.
This commit is contained in:
Daniel Pfeifer
2026-03-18 10:43:28 +01:00
parent 04480c2558
commit 498b6eb6b5
2 changed files with 5 additions and 2 deletions

View File

@@ -117,8 +117,12 @@ if(ENABLE_WALLET)
if(VCPKG_TARGET_TRIPLET)
# Use of the `unofficial::` namespace is a vcpkg package manager convention.
find_package(unofficial-sqlite3 CONFIG REQUIRED)
add_library(SQLite3::SQLite3 ALIAS unofficial::sqlite3::sqlite3)
else()
find_package(SQLite3 3.7.17 REQUIRED)
if(NOT TARGET SQLite3::SQLite3) # CMake < 4.3
add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3)
endif()
endif()
endif()
cmake_dependent_option(BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ${BUILD_TESTS} "ENABLE_WALLET" OFF)

View File

@@ -38,8 +38,7 @@ target_link_libraries(bitcoin_wallet
PRIVATE
core_interface
bitcoin_common
$<TARGET_NAME_IF_EXISTS:unofficial::sqlite3::sqlite3>
$<TARGET_NAME_IF_EXISTS:SQLite::SQLite3>
SQLite3::SQLite3
univalue
Boost::headers
$<TARGET_NAME_IF_EXISTS:USDT::headers>