From 57816cb520eb46e7ef1ace061751faa19262c151 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 22 Jul 2014 10:02:36 +0100 Subject: [PATCH] Detect c-ares header in cmake. --- lib/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index b7c37290..a907183b 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -51,8 +51,14 @@ if (WIN32) endif (WIN32) if (${WITH_SRV} STREQUAL ON) - add_definitions("-DWITH_SRV") - set (LIBRARIES ${LIBRARIES} cares) + # Simple detect c-ares + find_path(ARES_HEADER ares.h) + if (ARES_HEADER) + add_definitions("-DWITH_SRV") + set (LIBRARIES ${LIBRARIES} cares) + else (ARES_HEADER) + message(WARNING "c-ares library not found.") + endif (ARES_HEADER) endif (${WITH_SRV} STREQUAL ON) target_link_libraries(libmosquitto ${LIBRARIES})