Skip to content

CMake: handle deprecated SQLite::SQLite3 target#4693

Merged
rouault merged 3 commits intoOSGeo:masterfrom
jmckenna:FindSQLite-CMake-4.3
Mar 5, 2026
Merged

CMake: handle deprecated SQLite::SQLite3 target#4693
rouault merged 3 commits intoOSGeo:masterfrom
jmckenna:FindSQLite-CMake-4.3

Conversation

@jmckenna
Copy link
Copy Markdown
Contributor

@jmckenna jmckenna commented Mar 4, 2026

  • CMake >= 4.3 deprecates the SQLite::SQLite3 target (see FindSQLite3.html)
  • using today's CMake 4.3.0-rc2, with Visual Studio, and PROJ master, gives the following warnings:
CMake Warning (dev) at src/lib_proj.cmake:596 (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):
  src/CMakeLists.txt:9 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at src/lib_proj.cmake:596 (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):
  src/CMakeLists.txt:9 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at src/lib_proj.cmake:596 (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):
  src/CMakeLists.txt:9 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at src/lib_proj.cmake:596 (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):
  src/CMakeLists.txt:9 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at src/lib_proj.cmake:596 (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):
  src/CMakeLists.txt:9 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at src/lib_proj.cmake:596 (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):
  src/CMakeLists.txt:9 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at src/lib_proj.cmake:596 (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):
  src/CMakeLists.txt:9 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

@jmckenna
Copy link
Copy Markdown
Contributor Author

jmckenna commented Mar 4, 2026

@rouault can you give this a review?

@jmckenna jmckenna changed the title handle deprecated SQLite::SQLite3 target with CMake CMake: handle deprecated SQLite::SQLite3 target Mar 4, 2026
@jmckenna jmckenna marked this pull request as draft March 4, 2026 20:02
@jmckenna
Copy link
Copy Markdown
Contributor Author

jmckenna commented Mar 4, 2026

@rouault can you give this a review?

Oops, not yet :)

@jmckenna jmckenna marked this pull request as ready for review March 4, 2026 21:34
find_package(SQLite3 REQUIRED)

if(NOT TARGET SQLite3::SQLite3) # CMake < 4.3
set_target_properties(SQLite::SQLite3 PROPERTIES IMPORTED_GLOBAL TRUE)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jmckenna what happens if we don't specify set_target_properties(SQLite::SQLite3 PROPERTIES IMPORTED_GLOBAL TRUE) ?

Copy link
Copy Markdown
Contributor Author

@jmckenna jmckenna Mar 4, 2026

Choose a reason for hiding this comment

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

@jmckenna what happens if we don't specify set_target_properties(SQLite::SQLite3 PROPERTIES IMPORTED_GLOBAL TRUE) ?

I did that to handle the error in the workflow:

CMake Error at CMakeLists.txt:244 (add_library):
  add_library cannot create ALIAS target "SQLite3::SQLite3" because target
  "SQLite::SQLite3" is imported but not globally visible.

see run

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks, I was wondering since they don't mention it at https://cmake.org/cmake/help/latest/module/FindSQLite3.html

@rouault rouault added the backport 9.8 Backport to 9.8 branch label Mar 5, 2026
@rouault rouault merged commit fc4c131 into OSGeo:master Mar 5, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 9.8 Backport to 9.8 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants