File: CMakeLists.txt

package info (click to toggle)
syslog-ng 4.8.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,456 kB
  • sloc: ansic: 177,631; python: 13,035; cpp: 11,611; makefile: 7,012; sh: 5,147; java: 3,651; xml: 3,344; yacc: 1,377; lex: 599; perl: 193; awk: 190; objc: 162
file content (39 lines) | stat: -rw-r--r-- 822 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
if (NOT DEFINED ENABLE_MQTT OR ENABLE_MQTT)
  find_package(eclipse-paho-mqtt-c)
endif()

module_switch(ENABLE_MQTT "Enable mqtt" eclipse-paho-mqtt-c_FOUND)

if (ENABLE_MQTT AND NOT eclipse-paho-mqtt-c_FOUND)
  message (FATAL_ERROR "MQTT enabled but no eclipse-paho-mqtt-c library found")
endif ()

if (NOT ENABLE_MQTT)
  return()
endif()

CHECK_STRUCT_HAS_MEMBER("MQTTClient_connectOptions" "httpProxy" "MQTTClient.h" SYSLOG_NG_HAVE_PAHO_HTTP_PROXY)

set(MQTT_DIR ${CMAKE_CURRENT_SOURCE_DIR})

set(MQTT_COMMON
    mqtt-options.c
    mqtt-options.h
)

add_subdirectory(destination)
add_subdirectory(source)

set(MQTT_SOURCES
    mqtt-parser.c
    mqtt-parser.h
    mqtt-plugins.c
)

add_module(
  TARGET mqtt
  GRAMMAR mqtt-grammar
  DEPENDS mqtt-destination
  DEPENDS mqtt-source
  SOURCES ${MQTT_SOURCES} ${MQTT_COMMON}
)