You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mosquitto/plugins/persist-sqlite/CMakeLists.txt

47 lines
1.1 KiB
CMake

if(SQLITE3_FOUND AND CJSON_FOUND)
add_definitions("-DWITH_CJSON")
set(CLIENT_INC
"${SQLITE3_INCLUDE_DIRS}"
"${STDBOOL_H_PATH}"
"${STDINT_H_PATH}"
"${mosquitto_SOURCE_DIR}"
"${mosquitto_SOURCE_DIR}/deps"
"${mosquitto_SOURCE_DIR}/include"
"${mosquitto_SOURCE_DIR}/src"
)
set(CLIENT_DIR "${mosquitto_BINARY_DIR}/lib" "${SQLITE3_DIR}")
add_library(mosquitto_persist_sqlite MODULE
base_msgs.c
clients.c
client_msgs.c
init.c
plugin.c
restore.c
retain_msgs.c
subscriptions.c
tick.c
)
target_include_directories(mosquitto_persist_sqlite PRIVATE
${CLIENT_INC} ${SQLITE3_INCLUDE_DIR}
)
link_directories(${CLIENT_DIR} "${mosquitto_SOURCE_DIR}")
set_target_properties(mosquitto_persist_sqlite PROPERTIES
PREFIX ""
POSITION_INDEPENDENT_CODE 1
)
target_link_libraries(mosquitto_persist_sqlite ${SQLITE3_LIBRARIES})
if(WIN32)
target_link_libraries(mosquitto_persist_sqlite mosquitto)
endif()
install(TARGETS mosquitto_persist_sqlite
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()