block: also handle /dev/mdX (softraid) and /dev/mapper/* (LVM2) devices
[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 SET(LIBS ubox uci 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(block block.c
28 libblkid-tiny/libblkid-tiny.c
29 libblkid-tiny/md5.c
30 libblkid-tiny/mkdev.c
31 libblkid-tiny/ext.c
32 libblkid-tiny/jffs2.c
33 libblkid-tiny/vfat.c
34 libblkid-tiny/swap.c
35 libblkid-tiny/squashfs.c)
36 TARGET_LINK_LIBRARIES(block ${LIBS} blobmsg_json)
37
38 INSTALL(TARGETS block
39 RUNTIME DESTINATION sbin
40 )
41
42 ADD_EXECUTABLE(kmodloader kmodloader.c)
43 TARGET_LINK_LIBRARIES(kmodloader ${LIBS})
44
45 INSTALL(TARGETS kmodloader
46 RUNTIME DESTINATION sbin
47 )
48
49 ADD_EXECUTABLE(board board.c)
50 TARGET_LINK_LIBRARIES(board ${LIBS})
51
52 INSTALL(TARGETS board
53 RUNTIME DESTINATION sbin
54 )
55
56 ADD_EXECUTABLE(lsbloader lsbloader.c)
57 TARGET_LINK_LIBRARIES(lsbloader ${LIBS})
58
59 INSTALL(TARGETS lsbloader
60 RUNTIME DESTINATION sbin
61 )