-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDependencies.cmake
136 lines (119 loc) · 3.2 KB
/
Dependencies.cmake
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
include(cmake/CPM.cmake)
set(CPM_USE_LOCAL_PACKAGES OFF)
set(CPM_SOURCE_CACHE=$HOME/.cache/CPM)
# Done as a function so that updates to variables like
# CMAKE_CXX_FLAGS don't propagate out to other
# targets
function(cloysterhpc_setup_dependencies)
# For each dependency, see if it's
# already been provided to us by a parent project
if(NOT (TARGET Boost::headers OR TARGET Boost::system OR TARGET Boost::thread))
if (cloysterhpc_ENABLE_CONAN)
CPMFindPackage(NAME Boost)
else()
CPMAddPackage(
NAME Boost
VERSION 1.82.0
GITHUB_REPOSITORY "boostorg/boost"
GIT_TAG "boost-1.82.0"
)
endif()
endif()
if(NOT TARGET fmtlib::fmtlib)
if (cloysterhpc_ENABLE_CONAN)
CPMFindPackage(NAME fmt)
else()
CPMAddPackage("gh:fmtlib/fmt#9.1.0")
endif()
endif()
if(NOT TARGET spdlog::spdlog)
if (cloysterhpc_ENABLE_CONAN)
CPMFindPackage(NAME spdlog
OPTIONS
"SPDLOG_FMT_EXTERNAL ON")
else()
CPMAddPackage(
NAME
spdlog
VERSION
1.11.0
GITHUB_REPOSITORY
"gabime/spdlog"
OPTIONS
"SPDLOG_FMT_EXTERNAL ON")
endif()
endif()
if(NOT TARGET magic_enum::magic_enum)
if (cloysterhpc_ENABLE_CONAN)
CPMFindPackage(NAME magic_enum)
else()
CPMAddPackage(
NAME magic_enum
VERSION 0.9.3
GITHUB_REPOSITORY Neargye/magic_enum
#OPTIONS "MAGIC_ENUM_OPT_INSTALL YES"
)
endif()
endif()
if(NOT TARGET gsl-lite::gsl-lite)
if (cloysterhpc_ENABLE_CONAN)
CPMFindPackage(NAME gsl-lite)
else()
CPMAddPackage("gh:gsl-lite/gsl-lite@0.41.0")
endif()
endif()
if(NOT TARGET CLI11::CLI11)
if (cloysterhpc_ENABLE_CONAN)
CPMFindPackage(NAME CLI11)
else()
CPMAddPackage("gh:CLIUtils/CLI11@2.3.2")
endif()
endif()
if(NOT TARGET doctest::doctest)
if (cloysterhpc_ENABLE_CONAN)
CPMFindPackage(NAME doctest)
else()
CPMAddPackage("gh:doctest/doctest@2.4.11")
endif()
endif()
if(NOT TARGET glibmm::glibmm)
if (cloysterhpc_ENABLE_CONAN)
CPMFindPackage(NAME glibmm)
else()
CPMAddPackage("gh:GNOME/glibmm@2.78.1")
endif()
endif()
if(NOT TARGET SDBusCpp::sdbus-c++)
if (cloysterhpc_ENABLE_CONAN)
CPMFindPackage(NAME sdbus-c++)
else()
CPMAddPackage(
VERSION 2.0.0
GITHUB_REPOSITORY
"Kistler-Group/sdbus-cpp")
endif()
endif()
if(NOT TARGET hwinfo)
CPMAddPackage(
NAME hwinfo
GITHUB_REPOSITORY lfreist/hwinfo
GIT_TAG main
OPTIONS "HWINFO_STATIC ON" "HWINFO_SHARED OFF")
endif()
# Packages only available with CPM
#if(NOT TARGET tools::tools)
# CPMAddPackage("gh:lefticus/tools#update_build_system")
#endif()
if(NOT TARGET SimpleIni::SimpleIni)
CPMAddPackage("gh:brofield/simpleini@4.20")
endif()
# Standalone packages
# Include module path for packages that we need to find or build
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
include(cmake/Findnewt.cmake)
if(NOT TARGET newt)
CPMFindPackage(NAME newt)
endif()
# Set the variable ${STDC++FS} to the correct library
include(cmake/Addstdcppfs.cmake)
endfunction()