-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
104 lines (79 loc) · 2.73 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
cmake_minimum_required(VERSION 3.15)
project(CompoundFs)
enable_testing()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 17)
set(gtest_force_shared_crt ON CACHE BOOL "Override option" FORCE)
set(INSTALL_GTEST OFF CACHE BOOL "Override option" FORCE)
set(BUILD_GMOCK OFF CACHE BOOL "Override option" FORCE)
#set(LZ4_BUILD_LEGACY_LZ4C OFF CACHE BOOL "Override option" FORCE)
add_definitions ( -D_UNICODE )
add_subdirectory(CompoundFs)
add_subdirectory(TestDriver)
add_subdirectory(Rfx)
add_subdirectory(TestRfx)
add_subdirectory(Sandbox)
source_group("" FILES
.clang-format
.gitignore
README.md
)
include(FetchContent)
#------------------------------------------------------------------------------
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
)
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
endif()
#------------------------------------------------------------------------------
if (WIN32)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.11.1
)
FetchContent_GetProperties(pybind11)
if(NOT pybind11_POPULATED)
FetchContent_Populate(pybind11)
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
#add_library(pybind11 INTERFACE)
#target_include_directories(pybind11 INTERFACE .)
endif()
endif()
#------------------------------------------------------------------------------
# FetchContent_Declare(
# lz4
# GIT_REPOSITORY https://github.com/lz4/lz4.git
# GIT_TAG v1.9.2
# )
# FetchContent_GetProperties(lz4)
# if(NOT lz4_POPULATED)
# FetchContent_Populate(lz4)
# add_subdirectory(${lz4_SOURCE_DIR}/contrib/cmake_unofficial ${lz4_BINARY_DIR})
# target_include_directories(lz4_static INTERFACE ${lz4_SOURCE_DIR})
# endif()
#------------------------------------------------------------------------------
FetchContent_Declare(
xxhash
GIT_REPOSITORY https://github.com/Cyan4973/xxHash.git
GIT_TAG v0.8.0
)
FetchContent_GetProperties(xxhash)
if(NOT xxhash_POPULATED)
FetchContent_Populate(xxhash)
add_library(xxhash ${xxhash_SOURCE_DIR}/xxhash.c ${xxhash_SOURCE_DIR}/xxhash.h)
target_include_directories(xxhash INTERFACE ${xxhash_SOURCE_DIR})
endif()
#------------------------------------------------------------------------------
#set_target_properties(gtest gtest_main lz4_static lz4cli xxhash PROPERTIES FOLDER External)
set_target_properties(gtest gtest_main xxhash PROPERTIES FOLDER External)
if(WIN32)
add_subdirectory(py_txfs)
endif()
add_test(NAME CompoundFsUnitTests COMMAND TestDriver)
add_test(NAME RfxUnitTests COMMAND TestRfx)