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-- 1,039 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 (ENABLE_MONGODB STREQUAL OFF)
  return()
endif()

find_package(libmongoc-1.0)
find_package(libbson-1.0)

module_switch(ENABLE_MONGODB "Enable mongodb destination driver" libmongoc-1.0_FOUND)

if (ENABLE_MONGODB)

  set(CMAKE_REQUIRED_INCLUDES ${MONGOC_INCLUDE_DIRS})
  set(CMAKE_REQUIRED_LIBRARIES ${MONGOC_LIBRARY})
  set(CMAKE_REQUIRED_LIBRARIES ${BSON_LIBRARY})
  check_symbol_exists(mongoc_uri_set_option_as_int32 "mongoc.h" SYSLOG_NG_HAVE_DECL_MONGOC_URI_SET_OPTION_AS_INT32)
  check_symbol_exists(MONGOC_URI_SERVERSELECTIONTIMEOUTMS "mongoc.h" SYSLOG_NG_HAVE_DECL_MONGOC_URI_SERVERSELECTIONTIMEOUTMS)

  set(AFMONGODB_SOURCES
    "afmongodb.h"
    "afmongodb.c"
    "afmongodb-worker.h"
    "afmongodb-worker.c"
    "afmongodb-parser.h"
    "afmongodb-parser.c"
    "afmongodb-private.h"
  )

  add_module(
    TARGET afmongodb
    GRAMMAR afmongodb-grammar
    INCLUDES ${MONGOC_INCLUDE_DIRS}
    DEPENDS ${MONGOC_LIBRARY}
    DEPENDS ${BSON_LIBRARY}
    SOURCES ${AFMONGODB_SOURCES}
  )

  add_test_subdirectory(tests)

endif()