mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-31 09:08:08 -07:00
Parameters SOCI_* disables/enables backends. This is straight forward for most of the backends. The mysql backend can either use mysql-connector-c or mariadb-connector-c. Which one of them is decided by the find_package mysql script provided by upstream. That does not work since we need to respect the use flags by the user and declare a dependency to the correct connector. Most of the complexity of this is due to mysql/mariadb and that is solved by providing a FindMySQL.cmake that takes parameters for mysql libs and headers. The cmake scripts do not call find_package for disabled backends, passing CMAKE_DISABLE_FIND_PACKAGE_*=TRUE in addition to SOCI_*=off will therefore produce cmake warnings. Signed-off-by: Jan-Espen Oversand <sigsegv@radiotube.org> Closes: https://bugs.gentoo.org/968287 Part-of: https://github.com/gentoo/gentoo/pull/45248 Closes: https://github.com/gentoo/gentoo/pull/45248 Signed-off-by: Kenton Groombridge <concord@gentoo.org>
9 lines
268 B
CMake
9 lines
268 B
CMake
if (NOT TARGET MySQL::MySQL)
|
|
set(MySQL_FOUND TRUE)
|
|
add_library(MySQL INTERFACE)
|
|
target_link_libraries(MySQL INTERFACE ${MySQL_LIBRARIES})
|
|
target_include_directories(MySQL SYSTEM INTERFACE ${MySQL_INCLUDE_DIRS})
|
|
add_library(MySQL::MySQL ALIAS MySQL)
|
|
endif()
|
|
|