1 cmake_minimum_required(VERSION 2.6) 2 3 PROJECT(fs-tools C) 4 ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-format-truncation) 5 6 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") 7 8 ADD_LIBRARY(fstools SHARED 9 libfstools/common.c 10 libfstools/snapshot.c 11 libfstools/extroot.c 12 libfstools/fit.c 13 libfstools/overlay.c 14 libfstools/volume.c 15 libfstools/mtd.c 16 libfstools/mount.c 17 libfstools/ubi.c 18 libfstools/rootdisk.c 19 libfstools/partname.c 20 libfstools/find.c) 21 TARGET_LINK_LIBRARIES(fstools ubox) 22 INSTALL(TARGETS fstools LIBRARY DESTINATION lib) 23 24 ADD_LIBRARY(blkid-tiny SHARED 25 libblkid-tiny/encode.c 26 libblkid-tiny/libblkid-tiny.c 27 libblkid-tiny/mkdev.c 28 libblkid-tiny/probe.c 29 libblkid-tiny/exfat.c 30 libblkid-tiny/ext.c 31 libblkid-tiny/jffs2.c 32 libblkid-tiny/vfat.c 33 libblkid-tiny/ntfs.c 34 libblkid-tiny/hfs.c 35 libblkid-tiny/swap.c 36 libblkid-tiny/ubi.c 37 libblkid-tiny/ubifs.c 38 libblkid-tiny/squashfs.c 39 libblkid-tiny/btrfs.c 40 libblkid-tiny/f2fs.c 41 ) 42 INSTALL(TARGETS blkid-tiny LIBRARY DESTINATION lib) 43 INSTALL(FILES libblkid-tiny/libblkid-tiny.h DESTINATION include) 44 45 ADD_LIBRARY(ubi-utils STATIC 46 libubi/libubi.c 47 libubi/libubi-tiny.c 48 libubi/ubiutils-common.c) 49 INSTALL(TARGETS ubi-utils ARCHIVE DESTINATION lib) 50 51 FIND_PATH(ubox_include_dir libubox/ulog.h) 52 INCLUDE_DIRECTORIES(${ubox_include_dir}) 53 54 SET_TARGET_PROPERTIES(ubi-utils PROPERTIES COMPILE_FLAGS 55 "-ffunction-sections -fdata-sections") 56 57 INSTALL(FILES libubi/libubi-tiny.h libubi/libubi.h libubi/ubi-media.h 58 libubi/ubi-user.h libubi/ubi-media.h 59 DESTINATION include 60 ) 61 62 IF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB) 63 ADD_DEFINITIONS(-DOVL_MOUNT_COMPRESS_ZLIB) 64 ENDIF(DEFINED CMAKE_OVL_MOUNT_COMPRESS_ZLIB) 65 66 IF(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME) 67 ADD_DEFINITIONS(-DOVL_MOUNT_FULL_ACCESS_TIME) 68 ENDIF(DEFINED CMAKE_OVL_MOUNT_FULL_ACCESS_TIME) 69 70 ADD_EXECUTABLE(mount_root mount_root.c) 71 TARGET_LINK_LIBRARIES(mount_root fstools) 72 INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin) 73 74 find_library(json NAMES json-c json) 75 76 ADD_EXECUTABLE(blockd blockd.c) 77 TARGET_LINK_LIBRARIES(blockd fstools ubus blobmsg_json ${json}) 78 INSTALL(TARGETS blockd RUNTIME DESTINATION sbin) 79 80 ADD_EXECUTABLE(block block.c probe.c probe-libblkid.c) 81 IF(DEFINED CMAKE_UBIFS_EXTROOT) 82 ADD_DEFINITIONS(-DUBIFS_EXTROOT) 83 TARGET_LINK_LIBRARIES(block blkid-tiny dl uci ubox ubus blobmsg_json ubi-utils ${json}) 84 ELSE(DEFINED CMAKE_UBIFS_EXTROOT) 85 TARGET_LINK_LIBRARIES(block blkid-tiny dl uci ubox ubus blobmsg_json ${json}) 86 ENDIF(DEFINED CMAKE_UBIFS_EXTROOT) 87 INSTALL(TARGETS block RUNTIME DESTINATION sbin) 88 89 ADD_EXECUTABLE(jffs2reset jffs2reset.c) 90 TARGET_LINK_LIBRARIES(jffs2reset fstools) 91 INSTALL(TARGETS jffs2reset RUNTIME DESTINATION sbin) 92 93 ADD_EXECUTABLE(snapshot_tool snapshot.c) 94 TARGET_LINK_LIBRARIES(snapshot_tool fstools) 95 INSTALL(TARGETS snapshot_tool RUNTIME DESTINATION sbin) 96 97 ADD_EXECUTABLE(ubi ubi.c) 98 TARGET_LINK_LIBRARIES(ubi ubi-utils ubox) 99 INSTALL(TARGETS ubi RUNTIME DESTINATION sbin)
This page was automatically generated by LXR 0.3.1. • OpenWrt