add support for module handling
[project/ubox.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 PROJECT(procd 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 SET(LIBS ubox ubus ${json} blobmsg_json)
15
16 IF(DEBUG)
17   ADD_DEFINITIONS(-DDEBUG -g3)
18 ENDIF()
19
20 ADD_EXECUTABLE(mount_root mount_root.c)
21 TARGET_LINK_LIBRARIES(mount_root ${LIBS})
22
23 INSTALL(TARGETS mount_root
24         RUNTIME DESTINATION sbin
25 )
26
27 ADD_EXECUTABLE(kmodloader kmodloader.c)
28 TARGET_LINK_LIBRARIES(kmodloader ${LIBS})
29
30 INSTALL(TARGETS kmodloader
31         RUNTIME DESTINATION sbin
32 )
33
34 ADD_EXECUTABLE(board board.c)
35 TARGET_LINK_LIBRARIES(board ${LIBS})
36
37 INSTALL(TARGETS board
38         RUNTIME DESTINATION sbin
39 )
40
41 ADD_EXECUTABLE(lsbloader lsbloader.c)
42 TARGET_LINK_LIBRARIES(lsbloader ${LIBS})
43
44 INSTALL(TARGETS lsbloader
45         RUNTIME DESTINATION sbin
46 )