-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
75 lines (62 loc) · 1.91 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
cmake_minimum_required(VERSION 3.12)
find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif (CCACHE_FOUND)
option(TESTING "Enable tests" OFF)
option(BENCHMARK "Enable benchmark" OFF)
if (TESTING OR BENCHMARK)
include("cmake/3rdparty/Hunter/init.cmake")
HunterGate(
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.25.3-qdrvm19.zip
SHA1 eed8b8333c14f25176d4af4fb26256981fd1b527
)
endif ()
project(novelpoly-reed-solomon-crust C CXX)
include(FindPackageHandleStandardArgs)
include(cmake/functions.cmake)
include(cmake/rust.cmake)
if (NOT EXISTS "${CMAKE_TOOLCHAIN_FILE}")
# https://cgold.readthedocs.io/en/latest/tutorials/toolchain/globals/cxx-standard.html#summary
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
endif ()
add_subdirectory(ec-cpp)
if (TESTING)
enable_testing()
add_subdirectory(test)
endif ()
if (BENCHMARK)
add_subdirectory(benchmark)
endif ()
# TODO: Consider changing to CMake 3.23 FILE_SETs
install(
DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
export(EXPORT erasure_coding_crust_targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/erasure_coding_crust/erasure_coding_crustTargets.cmake"
NAMESPACE erasure_coding_crust::
)
configure_file(cmake/erasure_coding_crustConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/erasure_coding_crust/erasure_coding_crustConfig.cmake"
COPYONLY
)
set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/erasure_coding_crust)
install(EXPORT erasure_coding_crust_targets
FILE
erasure_coding_crustTargets.cmake
NAMESPACE
erasure_coding_crust::
DESTINATION
${ConfigPackageLocation}
)
install(
FILES
cmake/erasure_coding_crustConfig.cmake
DESTINATION
${ConfigPackageLocation}
)