-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
70 lines (57 loc) · 1.85 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
cmake_minimum_required(VERSION 3.8)
project(MyFS)
#set(CMAKE_VRBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(MKFS
src/mkfs.myfs.cpp
src/blockdevice.cpp
src/dmap.cpp
src/fat.cpp
src/root.cpp
includes/log.h)
set(MOUNT
src/blockdevice.cpp
src/myfs.cpp
src/wrap.cpp
src/mount.myfs.c
src/dmap.cpp
src/fat.cpp
src/root.cpp
includes/log.h)
set(UNITTEST
src/blockdevice.cpp
src/myfs.cpp
src/dmap.cpp
src/fat.cpp
src/root.cpp
unittests/main.cpp
unittests/test-blockdevice.cpp
unittests/test-myfs.cpp
unittests/test-filesystemIO.cpp
unittests/test-dmap.cpp
unittests/test-fat.cpp
unittests/test-root.cpp
unittests/helper.cpp
unittests/test-myfs-mkfs.cpp
includes/log.h)
include_directories(includes)
set(COMPILE_FLAGS "-Wall -DFUSE_USE_VERSION=26"
"-D_FILE_OFFSET_BITS=64")
add_definitions(${COMPILE_FLAGS})
add_executable(mkfs.myfs ${MKFS})
add_executable(mount.myfs ${MOUNT})
add_executable(unittest ${UNITTEST})
find_package(PkgConfig)
pkg_check_modules(FUSE fuse)
target_link_libraries(mkfs.myfs ${FUSE_LDFLAGS})
target_compile_options(mkfs.myfs PUBLIC ${FUSE_CFLAGS})
target_include_directories(mkfs.myfs PUBLIC ${FUSE_INCLUDE_DIRS})
target_link_libraries(mount.myfs ${FUSE_LDFLAGS})
target_compile_options(mount.myfs PUBLIC ${FUSE_CFLAGS})
target_include_directories(mount.myfs PUBLIC ${FUSE_INCLUDE_DIRS})
target_link_libraries(unittest ${FUSE_LDFLAGS})
target_compile_options(unittest PUBLIC ${FUSE_CFLAGS})
target_include_directories(unittest PUBLIC ${FUSE_INCLUDE_DIRS})