diff --git a/CMakeLists.txt b/CMakeLists.txt index 782185c9..30d6f598 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,8 @@ else (${WITH_TLS} STREQUAL ON) set (OPENSSL_INCLUDE_DIR "") endif (${WITH_TLS} STREQUAL ON) +option(WITH_SRV "Include SRV lookup support?" ON) + # ======================================== # Include projects # ======================================== diff --git a/ChangeLog.txt b/ChangeLog.txt index d51cdd20..172606a7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -20,6 +20,7 @@ Client library: - Fix topic matching edge case. - Fix callback deadlocks after calling mosquitto_disconnect(), when using the threaded interfaces. Closes bug #1313725. +- Fix SRV support when building with CMake. General: - Use $(STRIP) for stripping binaries when installing, to allow easier cross diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 14abcbec..97e5dae4 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -4,6 +4,10 @@ link_directories(${mosquitto_BINARY_DIR}/lib) set(shared_src client_shared.c client_shared.h) +if (${WITH_SRV} STREQUAL ON) + add_definitions("-DWITH_SRV") +endif (${WITH_SRV} STREQUAL ON) + add_executable(mosquitto_pub pub_client.c ${shared_src}) add_executable(mosquitto_sub sub_client.c ${shared_src}) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 2ae6f6a6..b7c37290 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -50,8 +50,8 @@ if (WIN32) set (LIBRARIES ${LIBRARIES} ws2_32) endif (WIN32) -option(WITH_SRV "Include SRV lookup support?" ON) if (${WITH_SRV} STREQUAL ON) + add_definitions("-DWITH_SRV") set (LIBRARIES ${LIBRARIES} cares) endif (${WITH_SRV} STREQUAL ON)