Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.0.0
-
None
-
e74fd6897bbb511fe365e8189e04c0cdc4d51655 (qt/qtbase/dev)
Description
The FindMySQL module in qtbase/cmake contains the following code:
find_path(MySQL_INCLUDE_DIRS NAMES mysql.h HINTS ${PC_MySQL_INCLUDEDIR} PATH_SUFFIXES mysql) find_library(MySQL_LIBRARIES NAMES mysqlclient HINTS ${PC_MySQL_LIBDIR} ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(MySQL DEFAULT_MSG MySQL_LIBRARIES MySQL_INCLUDE_DIRS)
This is not following the CMake conventions, as documented here:
https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#standard-variable-names
Specifically, the find_path() and find_library() calls should use the singular variable names MySQL_INCLUDE_DIR and MySQL_LIBRARY respectively. These commands are finding a single entity. The plural version of these variable names should not be stored in the cache and should be formed by populating them from the singular versions. The singular variable names should also be given to find_package_handle_standard_args().
Note that there are also configure scripts and documentation that are using the plural forms too and would need to be updated as well. I don't know the history of this module, if it pre-dates Qt6 it might already be too late to change this. If necessary, we could probably add some logic to fall back to the plural forms if the singular forms are not populated but the plural forms are in the cache.
Attachments
For Gerrit Dashboard: QTBUG-89866 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
329141,6 | Adjust database packages FindFoo.cmake files to CMake convention | dev | qt/qtbase | Status: MERGED | +2 | 0 |