ubox/logd: free ubus context on exit
[project/ubox.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 PROJECT(ubox C)
4 ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)
5
6 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
7
8 IF(APPLE)
9   INCLUDE_DIRECTORIES(/opt/local/include)
10   LINK_DIRECTORIES(/opt/local/lib)
11 ENDIF()
12
13 find_library(json NAMES json-c json)
14
15 IF(DEBUG)
16   ADD_DEFINITIONS(-DDEBUG -g3)
17 ENDIF()
18
19 ADD_EXECUTABLE(getrandom getrandom.c)
20 INSTALL(TARGETS getrandom
21         RUNTIME DESTINATION bin
22 )
23
24 ADD_EXECUTABLE(kmodloader kmodloader.c)
25 TARGET_LINK_LIBRARIES(kmodloader ubox)
26
27 INSTALL(TARGETS kmodloader
28         RUNTIME DESTINATION sbin
29 )
30
31 ADD_EXECUTABLE(lsbloader lsbloader.c)
32 TARGET_LINK_LIBRARIES(lsbloader ubox ubus)
33
34 INSTALL(TARGETS lsbloader
35         RUNTIME DESTINATION sbin
36 )
37
38 ADD_LIBRARY(validate SHARED validate/validate.c)
39 INSTALL(TARGETS validate
40         LIBRARY DESTINATION lib
41 )
42
43 FIND_PATH(uci_include_dir uci.h)
44 INCLUDE_DIRECTORIES(${uci_include_dir})
45
46 ADD_EXECUTABLE(validate_data validate/cli.c)
47 TARGET_LINK_LIBRARIES(validate_data ubox uci validate)
48 INSTALL(TARGETS validate_data
49         RUNTIME DESTINATION sbin
50 )
51
52 ADD_EXECUTABLE(logd log/logd.c log/syslog.c)
53 TARGET_LINK_LIBRARIES(logd ubox ubus)
54 INSTALL(TARGETS logd
55         RUNTIME DESTINATION sbin
56 )
57
58 ADD_EXECUTABLE(logread log/logread.c)
59 TARGET_LINK_LIBRARIES(logread ubox ubus ${json} blobmsg_json)
60 INSTALL(TARGETS logread
61         RUNTIME DESTINATION sbin
62 )