Newer
Older
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
cmake_minimum_required(VERSION 3.11)
project(gkfs.io
VERSION 0.1
LANGUAGES CXX
)
add_executable(gkfs.io
gkfs.io/main.cpp
gkfs.io/commands.hpp
gkfs.io/mkdir.cpp
gkfs.io/open.cpp
gkfs.io/opendir.cpp
gkfs.io/read.cpp
gkfs.io/readdir.cpp
gkfs.io/reflection.hpp
gkfs.io/rmdir.cpp
gkfs.io/serialize.hpp
gkfs.io/stat.cpp
gkfs.io/write.cpp
)
include(FetchContent)
set(FETCHCONTENT_QUIET OFF)
FetchContent_Declare(cli11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
GIT_TAG dd0d8e4fe729e5b1110232c7a5c9566dad884686 # v1.9.0
GIT_SHALLOW ON
GIT_PROGRESS ON
)
FetchContent_Declare(nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json
GIT_TAG e7b3b40b5a95bc74b9a7f662830a27c49ffc01b4 # v3.7.3
GIT_SHALLOW ON
GIT_PROGRESS ON
)
FetchContent_GetProperties(cli11)
if(NOT cli11_POPULATED)
FetchContent_Populate(cli11)
message(STATUS "[gkfs.io] CLI11 source dir: ${cli11_SOURCE_DIR}")
message(STATUS "[gkfs.io] CLI11 binary dir: ${cli11_BINARY_DIR}")
add_subdirectory(${cli11_SOURCE_DIR} ${cli11_BINARY_DIR})
endif()
FetchContent_GetProperties(nlohmann_json)
if(NOT nlohmann_json_POPULATED)
FetchContent_Populate(nlohmann_json)
message(STATUS "[gkfs.io] Nlohmann JSON source dir: ${nlohmann_json_SOURCE_DIR}")
message(STATUS "[gkfs.io] Nlohmann JSON binary dir: ${nlohmann_json_BINARY_DIR}")
set(JSON_BuildTests OFF CACHE INTERNAL "")
add_subdirectory(${nlohmann_json_SOURCE_DIR} ${nlohmann_json_BINARY_DIR})
endif()
target_include_directories(gkfs.io PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/gkfs.io>
)
target_link_libraries(gkfs.io
CLI11::CLI11
nlohmann_json::nlohmann_json
fmt::fmt
)