diff --git a/CHANGELOG.md b/CHANGELOG.md index 83fb58b..86a23a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- ## [Unreleased] +## [v2.1.18] + +### Fixes + +- fix(cmake): make SQLite target normalization robust across CMake versions + Replaced fragile SQLite alias normalization with imported compatibility targets so exported Vix packages work reliably with both `SQLite::SQLite3` and `SQLite3::SQLite3`. + +- fix(run): resolve remaining `vix run` failures caused by exported websocket SQLite dependency handling + +### Improvements + +- improve(config): strengthen package compatibility for consumers using older and newer CMake versions + ## [v2.1.17] ### Fixes diff --git a/cmake/VixConfig.cmake.in b/cmake/VixConfig.cmake.in index cf7eca4..e39f3da 100644 --- a/cmake/VixConfig.cmake.in +++ b/cmake/VixConfig.cmake.in @@ -21,22 +21,39 @@ endif() if (@VIX_WITH_SQLITE@) find_dependency(SQLite3 REQUIRED) - # Canonical target expected by exported Vix targets. + # CMake < 4.3 commonly provides SQLite::SQLite3. + # CMake >= 4.3 provides SQLite3::SQLite3. + # Normalize both names so exported Vix targets always work. + if (TARGET SQLite::SQLite3 AND NOT TARGET SQLite3::SQLite3) - add_library(SQLite3::SQLite3 ALIAS SQLite::SQLite3) + add_library(SQLite3::SQLite3 INTERFACE IMPORTED) + set_property(TARGET SQLite3::SQLite3 PROPERTY + INTERFACE_LINK_LIBRARIES SQLite::SQLite3 + ) elseif (TARGET sqlite3 AND NOT TARGET SQLite3::SQLite3) - add_library(SQLite3::SQLite3 ALIAS sqlite3) + add_library(SQLite3::SQLite3 INTERFACE IMPORTED) + set_property(TARGET SQLite3::SQLite3 PROPERTY + INTERFACE_LINK_LIBRARIES sqlite3 + ) endif() - # Optional compatibility alias for projects that use SQLite::SQLite3. if (TARGET SQLite3::SQLite3 AND NOT TARGET SQLite::SQLite3) - add_library(SQLite::SQLite3 ALIAS SQLite3::SQLite3) + add_library(SQLite::SQLite3 INTERFACE IMPORTED) + set_property(TARGET SQLite::SQLite3 PROPERTY + INTERFACE_LINK_LIBRARIES SQLite3::SQLite3 + ) elseif (TARGET sqlite3 AND NOT TARGET SQLite::SQLite3) - add_library(SQLite::SQLite3 ALIAS sqlite3) + add_library(SQLite::SQLite3 INTERFACE IMPORTED) + set_property(TARGET SQLite::SQLite3 PROPERTY + INTERFACE_LINK_LIBRARIES sqlite3 + ) endif() if (NOT TARGET SQLite3::SQLite3) - message(FATAL_ERROR "SQLite requested but no usable SQLite target was found (SQLite3::SQLite3 / SQLite::SQLite3 / sqlite3).") + message(FATAL_ERROR + "SQLite requested but no usable SQLite target was found " + "(SQLite3::SQLite3 / SQLite::SQLite3 / sqlite3)." + ) endif() endif()