Skip to content

Conversation

@jcar87
Copy link
Contributor

@jcar87 jcar87 commented Jul 18, 2025

The PR that introduced the find_package capabilities does not follow usual CMake conventions, namely:

  • the package has two different names, depending on whether shared or static was built
  • the exported targets are not prefixed with a cmake namespace

this PR introduces this, such the config and targets work for the following:

  • find_package(sqlite3mc) works
  • target_link_libraries(xxx PRIVATE sqlite3mc::sqlite3mc_static)
  • OR target_link_libraries(xxx PRIVATE sqlite3mc::sqlite3mc)

This is in line with current CMake convention (one may want to consider having the sqlite3mc::sqlite3mc be an alias for the static recipe if the shared one is not available).

By all means, feel free to disregard this PR altogether - it's just something that I noticed while reviewing conan-io/conan-center-index#27924. Lack of a namespace is relatively common (but not recommended), but the package having different names is rather unusual.

@utelle utelle merged commit c93df9b into utelle:main Jul 18, 2025
11 checks passed
@utelle
Copy link
Owner

utelle commented Jul 18, 2025

@jcar87 Thank you very much for providing these improvements to the CMake build.

@jcar87 jcar87 deleted the bugfix/cmake-find-package branch July 18, 2025 16:49
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