[feature] Provide Config Files and Imported Targets for CMake.
Posted by: Haowei Hsu
Date: November 02, 2022 02:55AM

It is an upcoming trend to link libraries with an IMPORTED library targets when using CMake.
However, according to my observation, MySQL-Connector/C (libmysqlclient) doesn't prepare a Config Files for find_package().
Therefore, some projects or users may need to design their own Module Files called "FindMySQL.cmake" as an alternative solution.

The followings are the "FindMySQL.cmake" that I found:

- SOCI: https://github.com/SOCI/soci/blob/master/cmake/modules/FindMySQL.cmake
- VTK: https://github.com/Kitware/VTK/blob/master/CMake/FindMySQL.cmake
- Debian: https://sources.debian.org/src/mysql-connector-c%2B%2B/1.1.12-4/FindMySQL.cmake/
- kexi: https://github.com/KDE/kexi/blob/master/cmake/modules/FindMySQL.cmake
- poco: https://github.com/pocoproject/poco/blob/master/cmake/FindMySQL.cmake
- sqlpp11: https://github.com/rbock/sqlpp11/blob/main/cmake/FindMySQL.cmake

However, their IMPORTED library targets differ, and some of them doesn't even define it. For example:

- MySQL::client

I hope MySQL can provide an official Config Files, for example "MySQLConfig.cmake",
and then define an official IMPORTED library target for MySQL-Connector/C (libmysqlclient)

BTW, I noticed that there is a comment noted in MySQL-Connector/C++ project.

- Link: https://github.com/mysql/mysql-connector-cpp/blob/8.0.31/jdbc/CMakeLists.txt#L139
- Comment: Arrange for MySQL::client to refer to the static library

Does it mean that MySQL official is preparing to do so and already decided to name its official IMPORTED target name as "MySQL::client"?

Options: ReplyQuote

Written By
[feature] Provide Config Files and Imported Targets for CMake.
November 02, 2022 02:55AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.