-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
99 lines (66 loc) · 1.9 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
# Generated by `boostdep --cmake hash2`
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.8...3.20)
project(boost_hash2 VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_hash2 INTERFACE)
add_library(Boost::hash2 ALIAS boost_hash2)
target_include_directories(boost_hash2 INTERFACE include)
target_link_libraries(boost_hash2
INTERFACE
Boost::assert
Boost::config
Boost::container_hash
Boost::describe
Boost::mp11
)
target_compile_features(boost_hash2 INTERFACE cxx_std_11)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
include(CTest) # defines BUILD_TESTING
include(FetchContent)
FetchContent_Declare(boostorg_cmake GIT_REPOSITORY https://github.com/boostorg/cmake GIT_TAG master)
FetchContent_MakeAvailable(boostorg_cmake)
FetchContent_GetProperties(boostorg_cmake)
list(APPEND CMAKE_MODULE_PATH ${boostorg_cmake_SOURCE_DIR}/include)
endif()
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(deps
# hash2
assert
config
container_hash
describe
mp11
# tests
array
core
utility
# benchmark
unordered
# example
endian
# secondaries
static_assert
throw_exception
io
preprocessor
type_traits
predef
)
set(BUILD_TESTING OFF) # Hide cache variable
list(LENGTH deps n)
set(i 0)
foreach(dep IN LISTS deps)
math(EXPR i "${i}+1")
message(STATUS "Fetching boostorg/${dep} [${i}/${n}]")
FetchContent_Declare(boostorg_${dep} GIT_REPOSITORY https://github.com/boostorg/${dep} GIT_TAG master EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(boostorg_${dep})
endforeach()
unset(BUILD_TESTING)
add_subdirectory(benchmark)
add_subdirectory(example)
endif()