-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
84 lines (71 loc) · 1.76 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 3.21)
project(
"vfs"
VERSION 0.0.1
LANGUAGES CXX
)
option(${PROJECT_NAME}_TESTS "Enable ${PROJECT_NAME} tests targets." ${PROJECT_IS_TOP_LEVEL})
option(${PROJECT_NAME}_TIDY "Run clang-tidy for ${PROJECT_NAME}." ${PROJECT_IS_TOP_LEVEL})
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_library(
vfs SHARED
include/vfs/directory_entry.hpp
include/vfs/directory_iterator.hpp
include/vfs/fs.hpp
include/vfs.hpp
internal/vfs/impl/entry.hpp
internal/vfs/impl/file_proxy.hpp
internal/vfs/impl/file.hpp
internal/vfs/impl/fs_proxy.hpp
internal/vfs/impl/fs.hpp
internal/vfs/impl/mem_file.hpp
internal/vfs/impl/mount_point.hpp
internal/vfs/impl/os_file.hpp
internal/vfs/impl/os_fs.hpp
internal/vfs/impl/union_file.hpp
internal/vfs/impl/utils.hpp
internal/vfs/impl/vfile.hpp
internal/vfs/impl/vfs.hpp
src/copy.cpp
src/entry.cpp
src/file.cpp
src/fs.cpp
src/mem_file.cpp
src/mem_fs.cpp
src/mount.cpp
src/os_file.cpp
src/os_fs.cpp
src/union_file.cpp
src/union_fs.cpp
src/utils.cpp
src/vfile.cpp
src/vfs.cpp
)
target_include_directories(
vfs
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
$<BUILD_INTERFACE:$<$<BOOL:$<TARGET_PROPERTY:vfs_INTERNAL>>:${CMAKE_CURRENT_SOURCE_DIR}/internal>>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/internal>
)
add_library(
vfs::vfs
ALIAS vfs
)
if(${PROJECT_NAME}_TIDY)
find_program(
CLANG_TIDY REQUIRED
NAMES clang-tidy-17 clang-tidy-16 clang-tidy
)
set_target_properties(
vfs PROPERTIES
CXX_CLANG_TIDY ${CLANG_TIDY}
)
endif()
if(${PROJECT_NAME}_TESTS)
add_subdirectory(tests)
endif()