Skip to content

Fixed deprecated CMake target SQLite::SQLite3 -> SQLite3::SQLite3#1484

Merged
fnc12 merged 3 commits into
fnc12:devfrom
Alvov1:fix/deprecated-sqlite3-cmake-target
May 11, 2026
Merged

Fixed deprecated CMake target SQLite::SQLite3 -> SQLite3::SQLite3#1484
fnc12 merged 3 commits into
fnc12:devfrom
Alvov1:fix/deprecated-sqlite3-cmake-target

Conversation

@Alvov1

@Alvov1 Alvov1 commented May 9, 2026

Copy link
Copy Markdown

CMake 4.3 deprecated the SQLite::SQLite3 target name in favour of SQLite3::SQLite3, producing dev warnings on configuration:

CMake Warning (dev): The library that is being linked to, SQLite::SQLite3, 
is marked as being deprecated by the owner. Please use SQLite3::SQLite3 instead.

A direct rename would break CMake < 4.3, where SQLite3::SQLite3 does not exist yet. Instead, a compatibility shim is added following the pattern recommended by CMake's own module documentation:
If SQLite3::SQLite3 is not yet defined, it is aliased to SQLite::SQLite3. This keeps the build warning-free on CMake >= 4.3 while remaining fully compatible with older versions down to the project's minimum of CMake 3.16.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fnc12 fnc12 requested review from fnc12 and trueqbit May 9, 2026 09:42
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread cmake/SqliteOrmConfig.cmake.in Outdated
@@ -1,4 +1,7 @@
include(CMakeFindDependencyMacro)
find_dependency(SQLite3)
if(NOT TARGET SQLite3::SQLite3) # CMake < 4.3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need this in the import target cmake file. It's not sqlite_orm's responsibility to alias SQLite3 for consumers of sqlite_orm.

@trueqbit trueqbit self-requested a review May 10, 2026 17:03
@fnc12 fnc12 merged commit 237b8e0 into fnc12:dev May 11, 2026
11 checks passed
@Alvov1 Alvov1 deleted the fix/deprecated-sqlite3-cmake-target branch June 2, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants