26 lines
860 B
CMake
26 lines
860 B
CMake
|
find_library(MariaDB_CLIENT_LIBRARIES mysqlclient NAMES mariadbclient)
|
||
|
find_path(MariaDB_INCLUDE_DIR mysql/mysql.h)
|
||
|
|
||
|
if (MariaDB_CLIENT_LIBRARIES AND MariaDB_INCLUDE_DIR)
|
||
|
set(MariaDB_FOUND TRUE)
|
||
|
endif()
|
||
|
|
||
|
if (MariaDB_FOUND)
|
||
|
add_library(MariaDB::client SHARED IMPORTED)
|
||
|
set_target_properties(MariaDB::client PROPERTIES
|
||
|
IMPORTED_LOCATION "${MariaDB_CLIENT_LIBRARIES}"
|
||
|
INTERFACE_LINK_LIBRARIES "${MariaDB_CLIENT_LIBRARIES}"
|
||
|
INTERFACE_INCLUDE_DIRECTORIES ${MariaDB_INCLUDE_DIR}/mysql
|
||
|
)
|
||
|
|
||
|
if (NOT MariaDB_FIND_QUIETLY)
|
||
|
message(STATUS "Found MariaDB includes: ${MariaDB_INCLUDE_DIR}/mysql")
|
||
|
message(STATUS "Found MariaDB client library: ${MariaDB_CLIENT_LIBRARIES}")
|
||
|
endif ()
|
||
|
else ()
|
||
|
if (MariaDB_FIND_REQUIRED)
|
||
|
message(FATAL_ERROR "Could NOT find MariaDB development files")
|
||
|
endif ()
|
||
|
endif ()
|
||
|
|