From edd74cca59bc4378fdcd714af7f0a399e69a12c5 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 17 Nov 2020 10:53:42 +0000 Subject: [PATCH] Fix cmake build of mosquitto_ctrl. --- apps/mosquitto_ctrl/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/mosquitto_ctrl/CMakeLists.txt b/apps/mosquitto_ctrl/CMakeLists.txt index c6770948..f2708ff3 100644 --- a/apps/mosquitto_ctrl/CMakeLists.txt +++ b/apps/mosquitto_ctrl/CMakeLists.txt @@ -24,6 +24,21 @@ if (WITH_TLS AND CJSON_FOUND) else() target_link_libraries(mosquitto_ctrl libmosquitto) endif() + + if (UNIX) + if (APPLE) + target_link_libraries(mosquitto_ctrl dl) + elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") + # + elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") + # + elseif(QNX) + # + else(APPLE) + target_link_libraries(mosquitto_ctrl dl) + endif (APPLE) + endif (UNIX) + target_link_libraries(mosquitto_ctrl ${OPENSSL_LIBRARIES} ${CJSON_LIBRARIES}) install(TARGETS mosquitto_ctrl RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")