|
|
|
@ -24,17 +24,7 @@ include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/lib
|
|
|
|
|
${OPENSSL_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR})
|
|
|
|
|
link_directories(${mosquitto_SOURCE_DIR}/lib)
|
|
|
|
|
|
|
|
|
|
add_library(libmosquitto SHARED
|
|
|
|
|
handle_connack.c
|
|
|
|
|
handle_ping.c
|
|
|
|
|
handle_pubackcomp.c
|
|
|
|
|
handle_publish.c
|
|
|
|
|
handle_pubrec.c
|
|
|
|
|
handle_pubrel.c
|
|
|
|
|
handle_suback.c
|
|
|
|
|
handle_unsuback.c
|
|
|
|
|
helpers.c
|
|
|
|
|
logging_mosq.c logging_mosq.h
|
|
|
|
|
set(C_SRC logging_mosq.c logging_mosq.h
|
|
|
|
|
memory_mosq.c memory_mosq.h
|
|
|
|
|
messages_mosq.c messages_mosq.h
|
|
|
|
|
mosquitto.c mosquitto.h
|
|
|
|
@ -58,6 +48,11 @@ add_library(libmosquitto SHARED
|
|
|
|
|
util_mosq.c util_mosq.h
|
|
|
|
|
will_mosq.c will_mosq.h)
|
|
|
|
|
|
|
|
|
|
add_library(libmosquitto SHARED ${C_SRC} )
|
|
|
|
|
|
|
|
|
|
#target for building static version of library
|
|
|
|
|
add_library(libmosquitto_static STATIC ${C_SRC})
|
|
|
|
|
|
|
|
|
|
set (LIBRARIES ${OPENSSL_LIBRARIES} ${PTHREAD_LIBRARIES})
|
|
|
|
|
|
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
@ -81,15 +76,25 @@ endif (${WITH_SRV} STREQUAL ON)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(libmosquitto ${LIBRARIES})
|
|
|
|
|
|
|
|
|
|
target_link_libraries(libmosquitto_static ${LIBRARIES})
|
|
|
|
|
|
|
|
|
|
set_target_properties(libmosquitto PROPERTIES
|
|
|
|
|
OUTPUT_NAME mosquitto
|
|
|
|
|
VERSION ${VERSION}
|
|
|
|
|
SOVERSION 1
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
install(TARGETS libmosquitto RUNTIME DESTINATION ${BINDIR} LIBRARY DESTINATION ${LIBDIR})
|
|
|
|
|
set_target_properties(libmosquitto_static PROPERTIES
|
|
|
|
|
OUTPUT_NAME mosquitto
|
|
|
|
|
VERSION ${VERSION}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_compile_definitions(libmosquitto_static PUBLIC "LIBMOSQUITTO_STATIC")
|
|
|
|
|
|
|
|
|
|
install(TARGETS libmosquitto libmosquitto_static RUNTIME DESTINATION ${BINDIR} LIBRARY DESTINATION ${LIBDIR} ARCHIVE DESTINATION ${LIBDIR})
|
|
|
|
|
install(FILES mosquitto.h DESTINATION ${INCLUDEDIR})
|
|
|
|
|
|
|
|
|
|
if (UNIX)
|
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
|
install(CODE "EXEC_PROGRAM(/sbin/ldconfig)")
|
|
|
|
|
endif (UNIX)
|
|
|
|
|
endif (UNIX AND NOT APPLE)
|
|
|
|
|
|
|
|
|
|