Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sqlite3] Provide cmake target SQLite::SQLite3 #31659

Closed
huangqinjin opened this issue May 27, 2023 · 9 comments · May be fixed by #41993 or #41970
Closed

[sqlite3] Provide cmake target SQLite::SQLite3 #31659

huangqinjin opened this issue May 27, 2023 · 9 comments · May be fixed by #41993 or #41970
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist Stale

Comments

@huangqinjin
Copy link
Contributor

CMake 3.14+ provides a official FindSQLite3 module and SQLite::SQLite3 target.

It would be good that vcpkg also provides the same name instead of unofficial::sqlite3::sqlite3. The FindSQLite3 module does not support multi-config generators well.

@dg0yt
Copy link
Contributor

dg0yt commented May 27, 2023

IMO the official target doesn't belong into the unofficial config.
But it could make sense to add a wrapper for cmake package SQLite3 which takes care of vcpkg's multi-config setup.

However, there are many official find modules which poorly support multi-config or static usage requirements. I just refreshed #27408 which tests some common modules incl. SQLite3.

@huangqinjin
Copy link
Contributor Author

Wonderful work in #27408 . Adding wrappers for all official find modules is great. As the maintainer of CMake states that they rarely add find modules anymore https://gitlab.kitware.com/cmake/cmake/-/issues/24607#note_1335831.

@dg0yt
Copy link
Contributor

dg0yt commented May 27, 2023

Well, #27408 is only the (modified) test port. It doesn't fix a single package for multi-config.
What is usually fixed quickly is broken single-config usage. (This is covered by the current version of the cmake-user test port.)

@SchaichAlonso
Copy link
Contributor

SchaichAlonso commented May 27, 2023

vcpkg's sqlite3 package does provide the SQLite::SQLite3 target.

See https://github.com/SchaichAlonso/vcpkg-sqlite-demo for a minimal project using that target. The github CI can use find_package(SQLite3) to find the vcpkg installed sqlite, imply all compile/link options via the SQLite::SQLite3 target and set it up to be used at run-time, too.

@huangqinjin
Copy link
Contributor Author

@SchaichAlonso Please build your demo with cmake --build . --config Release -- -v:n, you will see it links to debug version of sqlite3. (Though vcpkg will copy release version next to the built executable.)

SchaichAlonso added a commit to PurpleFlowerGarden/vcpkg-sqlite-demo that referenced this issue May 27, 2023
SchaichAlonso added a commit to PurpleFlowerGarden/vcpkg-sqlite-demo that referenced this issue May 27, 2023
@SchaichAlonso
Copy link
Contributor

... "vcpkg_installed\x64-windows\debug\lib\sqlite3.lib" ... from https://github.com/SchaichAlonso/vcpkg-sqlite-demo/actions/runs/5100058804/jobs/9168112436#step:3:109 is the (mis)behaviour you're refering to I guess

@dg0yt
Copy link
Contributor

dg0yt commented May 27, 2023

vcpkg's sqlite3 package does provide the SQLite::SQLite3 target.

This is not the point. The point is that it is not setup to provide multi-config info.
https://github.com/Kitware/CMake/blob/master/Modules/FindSQLite3.cmake

@FrankXie05 FrankXie05 self-assigned this May 29, 2023
@FrankXie05 FrankXie05 added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label May 29, 2023
@dg0yt dg0yt mentioned this issue May 29, 2023
5 tasks
Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist Stale
Projects
None yet
4 participants