2014-05-07 22:27:00 +00:00
|
|
|
include_directories(${mosquitto_SOURCE_DIR}/lib ${mosquitto_SOURCE_DIR}/lib/cpp
|
|
|
|
${STDBOOL_H_PATH} ${STDINT_H_PATH})
|
|
|
|
link_directories(${mosquitto_BINARY_DIR}/lib)
|
|
|
|
|
2018-01-06 22:42:13 +00:00
|
|
|
set(CPP_SRC mosquittopp.cpp mosquittopp.h)
|
2016-05-31 06:27:12 +00:00
|
|
|
|
2018-01-06 22:42:13 +00:00
|
|
|
add_library(mosquittopp SHARED ${CPP_SRC})
|
|
|
|
set_target_properties(mosquittopp PROPERTIES
|
2016-05-31 06:27:12 +00:00
|
|
|
POSITION_INDEPENDENT_CODE 1
|
|
|
|
)
|
2015-04-11 11:15:36 +00:00
|
|
|
target_link_libraries(mosquittopp libmosquitto)
|
2014-05-07 22:27:00 +00:00
|
|
|
set_target_properties(mosquittopp PROPERTIES
|
|
|
|
VERSION ${VERSION}
|
|
|
|
SOVERSION 1
|
|
|
|
)
|
2016-03-13 20:33:08 +00:00
|
|
|
install(TARGETS mosquittopp RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
|
2016-05-31 06:27:12 +00:00
|
|
|
|
2016-06-02 17:53:58 +00:00
|
|
|
if (${WITH_STATIC_LIBRARIES} STREQUAL ON)
|
2018-01-06 22:42:13 +00:00
|
|
|
add_library(mosquittopp_static STATIC
|
|
|
|
${C_SRC}
|
|
|
|
${CPP_SRC}
|
|
|
|
)
|
|
|
|
if (${WITH_PIC} STREQUAL ON)
|
|
|
|
set_target_properties(mosquittopp_static PROPERTIES
|
|
|
|
POSITION_INDEPENDENT_CODE 1
|
2016-05-31 06:27:12 +00:00
|
|
|
)
|
2018-01-06 22:42:13 +00:00
|
|
|
endif (${WITH_PIC} STREQUAL ON)
|
2016-05-31 06:27:12 +00:00
|
|
|
|
|
|
|
target_link_libraries(mosquittopp_static ${LIBRARIES})
|
|
|
|
|
|
|
|
set_target_properties(mosquittopp_static PROPERTIES
|
|
|
|
OUTPUT_NAME mosquittopp
|
|
|
|
VERSION ${VERSION}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_definitions(mosquittopp_static PUBLIC "LIBMOSQUITTO_STATIC")
|
2016-06-21 22:33:58 +00:00
|
|
|
install(TARGETS mosquittopp_static RUNTIME DESTINATION "${BINDIR}" ARCHIVE DESTINATION "${LIBDIR}")
|
2016-06-02 17:53:58 +00:00
|
|
|
endif (${WITH_STATIC_LIBRARIES} STREQUAL ON)
|
2016-05-31 06:27:12 +00:00
|
|
|
|
2016-03-13 20:33:08 +00:00
|
|
|
install(FILES mosquittopp.h DESTINATION "${INCLUDEDIR}")
|
2014-05-07 22:27:00 +00:00
|
|
|
|
2016-04-19 19:08:02 +00:00
|
|
|
if (UNIX AND NOT APPLE)
|
2014-05-07 22:27:00 +00:00
|
|
|
install(CODE "EXEC_PROGRAM(/sbin/ldconfig)")
|
2016-04-19 19:08:02 +00:00
|
|
|
endif (UNIX AND NOT APPLE)
|
|
|
|
|