[cmake] use mysql_config cflags and ldflags
x-ref:
"Meson / CMake build issues"
@@ -334,7 +334,9 @@ endif()
if(WITH_MYSQL)
xconfig(mysql_config MYSQL_LDFLAGS MYSQL_CFLAGS)
- check_library_exists(mysqlclient mysql_real_connect "" HAVE_MYSQL)
+ if(MYSQL_LDFLAGS)
+ set(HAVE_MYSQL TRUE)
+ endif()
else()
unset(HAVE_MYSQL)
endif()
@@ -1003,8 +1005,8 @@ endif()
if(HAVE_MYSQL)
add_and_install_library(mod_vhostdb_mysql "mod_vhostdb_mysql.c")
- target_link_libraries(mod_vhostdb_mysql mysqlclient)
- include_directories(/usr/include/mysql)
+ target_link_libraries(mod_vhostdb_mysql ${MYSQL_LDFLAGS})
+ add_target_properties(mod_vhostdb_mysql COMPILE_FLAGS ${MYSQL_CFLAGS})
endif()
if(HAVE_PGSQL)
