Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 24 additions & 7 deletions cmake/VixConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Loading