log: make valgrind less complain by freeing allocated memory
[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(kmodloader kmodloader.c)
20 TARGET_LINK_LIBRARIES(kmodloader ubox)
21
22 INSTALL(TARGETS kmodloader
23         RUNTIME DESTINATION sbin
24 )
25
26 ADD_EXECUTABLE(lsbloader lsbloader.c)
27 TARGET_LINK_LIBRARIES(lsbloader ubox ubus)
28
29 INSTALL(TARGETS lsbloader
30         RUNTIME DESTINATION sbin
31 )
32
33 ADD_LIBRARY(validate SHARED validate/validate.c)
34 INSTALL(TARGETS validate
35         LIBRARY DESTINATION lib
36 )
37
38 ADD_EXECUTABLE(validate_data validate/cli.c)
39 TARGET_LINK_LIBRARIES(validate_data ubox uci validate)
40 INSTALL(TARGETS validate_data
41         RUNTIME DESTINATION sbin
42 )
43
44 ADD_EXECUTABLE(logd log/logd.c log/syslog.c)
45 TARGET_LINK_LIBRARIES(logd ubox ubus)
46 INSTALL(TARGETS logd
47         RUNTIME DESTINATION sbin
48 )
49
50 ADD_EXECUTABLE(logread log/logread.c)
51 TARGET_LINK_LIBRARIES(logread ubox ubus ${json} blobmsg_json)
52 INSTALL(TARGETS logread
53         RUNTIME DESTINATION sbin
54 )