Skip to content

Fix CMake warnings about deprecated target SQLite::SQLite3#135

Merged
rbock merged 1 commit into
rbock:mainfrom
MeanSquaredError:sqlite_target
Jun 24, 2026
Merged

Fix CMake warnings about deprecated target SQLite::SQLite3#135
rbock merged 1 commit into
rbock:mainfrom
MeanSquaredError:sqlite_target

Conversation

@MeanSquaredError

@MeanSquaredError MeanSquaredError commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Trying to build sqlpp23 with CMake 4.3.0 and the following command line

cmake -B build -G Ninja -DBUILD_POSTGRESQL_CONNECTOR=ON -DBUILD_SQLITE3_CONNECTOR=ON -DBUILD_MYSQL_CONNECTOR=ON -DBUILD_TESTING=ON -DDEPENDENCY_CHECK=ON -DBUILD_WITH_MODULES=ON

will show a whole bunch of repeating warnings saying the following

CMake Warning (dev) at cmake/Sqlpp23TargetHelper.cmake:161 (target_link_libraries):
  The library that is being linked to, SQLite::SQLite3, is marked as being
  deprecated by the owner.  The message provided by the developer is:

  The target name SQLite::SQLite3 is deprecated.  Please use SQLite3::SQLite3
  instead.

Call Stack (most recent call first):
  cmake/Sqlpp23TargetHelper.cmake:111 (add_common)
  cmake/Sqlpp23TargetHelper.cmake:62 (add_regular_and_module)
  CMakeLists.txt:63 (add_component)
This warning is for project developers.  Use -Wno-dev to suppress it.

The CMake script that searches for SQLite3 and creates the targets is not provided by SQLite3 but comes with CMake itself, so I checked the source code at https://github.com/Kitware/CMake/blob/master/Modules/FindSQLite3.cmake
and the comments in the script pretty much confirmed what the comments say: with CMake 4.3.0 or newer the target should be SQLite3::SQLite3 instead of the old SQLite::SQLite3

So this fix checks the CMake version and uses the appropriate target.

@rbock

rbock commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Thanks for the fix.

FYI, I am still on CMake 3.31

@rbock rbock merged commit ff52d49 into rbock:main Jun 24, 2026
1 check passed
@MeanSquaredError

Copy link
Copy Markdown
Contributor Author

Well, in my case I am using Fedora 44, which defaults to CMake 4.3.0, and it actually updated to that version even without asking me whether I want that update. Well, it probably did ask at some point, but I just confirmed the update without checking what is actually being installed :-)

BTW I strongly suspect that the other build error, which I get when it tries to build the sqlpp core tests is caused at least partially by the new CMake version too. I am still investigating it and hopefully will find a fix (or at least a workaround) today.

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.

2 participants