pica/cmake/FindMariaDB.cmake

26 lines
860 B
CMake
Raw Normal View History

2023-12-07 20:32:43 +00:00
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 ()