2018-10-31 12:38:39 +00:00
|
|
|
set(shared_src client_shared.c client_shared.h client_props.c)
|
2014-05-25 10:02:31 +00:00
|
|
|
|
2019-01-10 15:51:34 +00:00
|
|
|
if (WITH_SRV)
|
2014-05-19 21:03:26 +00:00
|
|
|
add_definitions("-DWITH_SRV")
|
2019-01-10 15:51:34 +00:00
|
|
|
endif (WITH_SRV)
|
2014-05-19 21:03:26 +00:00
|
|
|
|
2020-10-13 14:52:01 +00:00
|
|
|
set( CLIENT_INC ${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/include
|
2019-10-15 10:59:22 +00:00
|
|
|
${STDBOOL_H_PATH} ${STDINT_H_PATH} ${PTHREAD_INCLUDE_DIR}
|
|
|
|
${OPENSSL_INCLUDE_DIR})
|
|
|
|
|
|
|
|
set( CLIENT_DIR ${mosquitto_BINARY_DIR}/lib)
|
|
|
|
|
|
|
|
if (CJSON_FOUND)
|
|
|
|
set( CLIENT_DIR "${CLIENT_DIR} ${CJSON_DIR}" )
|
|
|
|
set( CLIENT_INC "${CLIENT_INC};${CJSON_INCLUDE_DIRS}" )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(${CLIENT_INC})
|
|
|
|
link_directories(${CLIENT_DIR})
|
|
|
|
|
2018-11-21 22:47:33 +00:00
|
|
|
add_executable(mosquitto_pub pub_client.c pub_shared.c ${shared_src})
|
2018-03-15 11:21:42 +00:00
|
|
|
add_executable(mosquitto_sub sub_client.c sub_client_output.c ${shared_src})
|
2019-04-17 09:39:51 +00:00
|
|
|
add_executable(mosquitto_rr rr_client.c pub_shared.c sub_client_output.c ${shared_src})
|
2014-05-07 22:27:00 +00:00
|
|
|
|
2019-10-15 10:59:22 +00:00
|
|
|
if (CJSON_FOUND)
|
|
|
|
target_link_libraries(mosquitto_pub ${CJSON_LIBRARIES})
|
|
|
|
target_link_libraries(mosquitto_sub ${CJSON_LIBRARIES})
|
|
|
|
target_link_libraries(mosquitto_rr ${CJSON_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2019-08-06 11:01:29 +00:00
|
|
|
if (WITH_STATIC_LIBRARIES)
|
|
|
|
target_link_libraries(mosquitto_pub libmosquitto_static)
|
|
|
|
target_link_libraries(mosquitto_sub libmosquitto_static)
|
|
|
|
target_link_libraries(mosquitto_rr libmosquitto_static)
|
|
|
|
else()
|
|
|
|
target_link_libraries(mosquitto_pub libmosquitto)
|
|
|
|
target_link_libraries(mosquitto_sub libmosquitto)
|
|
|
|
target_link_libraries(mosquitto_rr libmosquitto)
|
|
|
|
endif()
|
2014-05-07 22:27:00 +00:00
|
|
|
|
2018-10-02 11:06:36 +00:00
|
|
|
if (QNX)
|
|
|
|
target_link_libraries(mosquitto_pub socket)
|
|
|
|
target_link_libraries(mosquitto_sub socket)
|
2019-03-30 21:19:51 +00:00
|
|
|
target_link_libraries(mosquitto_rr socket)
|
2018-10-02 11:06:36 +00:00
|
|
|
endif()
|
|
|
|
|
2019-04-26 14:51:48 +00:00
|
|
|
install(TARGETS mosquitto_pub RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
|
|
install(TARGETS mosquitto_sub RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
|
|
|
install(TARGETS mosquitto_rr RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|