# Find system packages # Required packages find_package(PkgConfig REQUIRED) # Upstream smartbotic-database client library — provides target smartbotic::db-client find_package(smartbotic-db-client CONFIG REQUIRED) find_package(Threads REQUIRED) find_package(OpenSSL REQUIRED) find_package(CURL REQUIRED) find_package(ZLIB REQUIRED) # nlohmann-json find_package(nlohmann_json 3.11 QUIET) if(NOT nlohmann_json_FOUND) pkg_check_modules(nlohmann_json REQUIRED IMPORTED_TARGET nlohmann_json) add_library(nlohmann_json::nlohmann_json ALIAS PkgConfig::nlohmann_json) endif() # spdlog find_package(spdlog QUIET) if(NOT spdlog_FOUND) pkg_check_modules(spdlog REQUIRED IMPORTED_TARGET spdlog) add_library(spdlog::spdlog ALIAS PkgConfig::spdlog) endif() # gRPC and Protobuf find_package(gRPC CONFIG QUIET) if(NOT gRPC_FOUND) pkg_check_modules(grpc++ REQUIRED IMPORTED_TARGET grpc++) add_library(gRPC::grpc++ ALIAS PkgConfig::grpc++) endif() find_package(Protobuf REQUIRED) # libwebsockets pkg_check_modules(websockets REQUIRED IMPORTED_TARGET libwebsockets) add_library(websockets ALIAS PkgConfig::websockets) # MySQL/MariaDB client pkg_check_modules(mariadb QUIET IMPORTED_TARGET libmariadb) if(mariadb_FOUND) add_library(mysql_client ALIAS PkgConfig::mariadb) set(MYSQL_CLIENT_FOUND TRUE CACHE BOOL "MySQL client library found") message(STATUS "Found MariaDB client library") else() pkg_check_modules(mysqlclient QUIET IMPORTED_TARGET mysqlclient) if(mysqlclient_FOUND) add_library(mysql_client ALIAS PkgConfig::mysqlclient) set(MYSQL_CLIENT_FOUND TRUE CACHE BOOL "MySQL client library found") message(STATUS "Found MySQL client library") else() set(MYSQL_CLIENT_FOUND FALSE CACHE BOOL "MySQL client library found") message(STATUS "MySQL/MariaDB client library not found - MySQL node support disabled") endif() endif() # PostgreSQL client (libpq) pkg_check_modules(libpq QUIET IMPORTED_TARGET libpq) if(libpq_FOUND) add_library(postgresql_client ALIAS PkgConfig::libpq) set(POSTGRESQL_CLIENT_FOUND TRUE CACHE BOOL "PostgreSQL client library found") message(STATUS "Found PostgreSQL client library (libpq)") else() set(POSTGRESQL_CLIENT_FOUND FALSE CACHE BOOL "PostgreSQL client library found") message(STATUS "PostgreSQL client library not found - PostgreSQL node support disabled") endif()