Revert "fstools: support for ext4fs overlay"
[project/fstools.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 PROJECT(fs-tools C)
4 ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations)
5
6 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
7
8 ADD_LIBRARY(fstools SHARED
9                 libfstools/snapshot.c
10                 libfstools/extroot.c
11                 libfstools/overlay.c
12                 libfstools/volume.c
13                 libfstools/mtd.c
14                 libfstools/mount.c
15                 libfstools/ubi.c
16                 libfstools/find.c)
17 TARGET_LINK_LIBRARIES(fstools ubox)
18 INSTALL(TARGETS fstools LIBRARY DESTINATION lib)
19
20 ADD_LIBRARY(blkid-tiny SHARED
21                 libblkid-tiny/libblkid-tiny.c
22                 libblkid-tiny/mkdev.c
23                 libblkid-tiny/ext.c
24                 libblkid-tiny/jffs2.c
25                 libblkid-tiny/vfat.c
26                 libblkid-tiny/hfs.c
27                 libblkid-tiny/swap.c
28                 libblkid-tiny/ubifs.c
29                 libblkid-tiny/squashfs.c
30                 libblkid-tiny/btrfs.c
31                 libblkid-tiny/f2fs.c
32                 )
33 INSTALL(TARGETS blkid-tiny LIBRARY DESTINATION lib)
34
35 ADD_LIBRARY(ubi-utils STATIC
36                 libubi/libubi.c
37                 libubi/libubi-tiny.c
38                 libubi/ubiutils-common.c)
39 INSTALL(TARGETS ubi-utils ARCHIVE DESTINATION lib)
40
41 SET_TARGET_PROPERTIES(ubi-utils PROPERTIES COMPILE_FLAGS
42                 "-ffunction-sections -fdata-sections")
43
44 INSTALL(FILES libubi/libubi-tiny.h libubi/libubi.h libubi/ubi-media.h
45                 libubi/ubi-user.h libubi/ubi-media.h
46         DESTINATION include
47 )
48
49 ADD_EXECUTABLE(mount_root mount_root.c)
50 TARGET_LINK_LIBRARIES(mount_root fstools)
51 INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin)
52
53 ADD_EXECUTABLE(block block.c)
54 IF(DEFINED CMAKE_UBIFS_EXTROOT)
55         ADD_DEFINITIONS(-DUBIFS_EXTROOT)
56         TARGET_LINK_LIBRARIES(block blkid-tiny uci ubox blobmsg_json ubi-utils)
57 ELSE(DEFINED CMAKE_UBIFS_EXTROOT)
58         TARGET_LINK_LIBRARIES(block blkid-tiny uci ubox blobmsg_json)
59 ENDIF(DEFINED CMAKE_UBIFS_EXTROOT)
60 INSTALL(TARGETS block RUNTIME DESTINATION sbin)
61
62 ADD_EXECUTABLE(jffs2reset jffs2reset.c)
63 TARGET_LINK_LIBRARIES(jffs2reset fstools)
64 INSTALL(TARGETS jffs2reset RUNTIME DESTINATION sbin)
65
66 ADD_EXECUTABLE(snapshot_tool snapshot.c)
67 TARGET_LINK_LIBRARIES(snapshot_tool fstools)
68 INSTALL(TARGETS snapshot_tool RUNTIME DESTINATION sbin)
69
70 ADD_EXECUTABLE(ubi ubi.c)
71 TARGET_LINK_LIBRARIES(ubi ubi-utils ubox)
72 INSTALL(TARGETS ubi RUNTIME DESTINATION sbin)