4c899479a6ed37d9522a7e713ce8adfc9ed99538
[project/procd.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 SET(SOURCES procd.c signal.c watchdog.c state.c inittab.c rcS.c ubus.c system.c
14 service/service.c service/instance.c service/validate.c service/trigger.c service/watch.c
15 plug/coldplug.c plug/hotplug.c utils/utils.c)
16
17 find_library(json NAMES json-c json)
18 SET(LIBS ubox ubus ${json} blobmsg_json json_script)
19
20 IF(DEBUG)
21 ADD_DEFINITIONS(-DDEBUG -g3)
22 ENDIF()
23
24
25 ADD_EXECUTABLE(procd ${SOURCES})
26 TARGET_LINK_LIBRARIES(procd ${LIBS})
27 INSTALL(TARGETS procd
28 RUNTIME DESTINATION sbin
29 )
30
31
32 ADD_EXECUTABLE(init initd/init.c initd/early.c initd/preinit.c initd/mkdev.c watchdog.c)
33 TARGET_LINK_LIBRARIES(init ${LIBS})
34 INSTALL(TARGETS init
35 RUNTIME DESTINATION sbin
36 )
37
38
39 ADD_EXECUTABLE(udevtrigger plug/udevtrigger.c)
40 INSTALL(TARGETS udevtrigger
41 RUNTIME DESTINATION sbin
42 )
43
44
45 ADD_EXECUTABLE(askfirst utils/askfirst.c)
46 INSTALL(TARGETS askfirst
47 RUNTIME DESTINATION sbin
48 )