forked from cpp-best-practices/cmake_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dependencies.cmake
123 lines (109 loc) · 2.9 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
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(myproject_setup_dependencies)
# For each dependency, see if it's
# already been provided to us by a parent project
# if(NOT TARGET boost::boost)
# if (myproject_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 (myproject_ENABLE_CONAN)
CPMFindPackage(NAME fmt)
else()
CPMAddPackage("gh:fmtlib/fmt#9.1.0")
endif()
endif()
if(NOT TARGET spdlog::spdlog)
if (myproject_ENABLE_CONAN)
CPMFindPackage(NAME spdlog)
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 (myproject_ENABLE_CONAN)
# CPMFindPackage(NAME magic_enum)
# else()
# CPMAddPackage(
# NAME magic_enum
# VERSION 0.9.3
# GITHUB_REPOSITORY Neargye/magic_enum
# )
# endif()
# endif()
#
# if(NOT TARGET gsl-lite::gsl-lite)
# if (myproject_ENABLE_CONAN)
# CPMFindPackage(NAME gsl-lite)
# else()
# CPMAddPackage("gh:gsl-lite/[email protected]")
# endif()
# endif()
if(NOT TARGET CLI11::CLI11)
if (myproject_ENABLE_CONAN)
CPMFindPackage(NAME CLI11)
else()
CPMAddPackage("gh:CLIUtils/[email protected]")
endif()
endif()
if(NOT TARGET ftxui::screen)
if (myproject_ENABLE_CONAN)
CPMFindPackage(NAME ftxui)
else()
CPMAddPackage("gh:ArthurSonzogni/FTXUI#e23dbc7473654024852ede60e2121276c5aab660")
endif()
endif()
if(NOT TARGET Catch2::Catch2WithMain)
if (myproject_ENABLE_CONAN)
CPMFindPackage(NAME Catch2)
else()
CPMAddPackage("gh:catchorg/[email protected]")
endif()
endif()
# if(NOT TARGET doctest::doctest)
# if (myproject_ENABLE_CONAN)
# CPMFindPackage(NAME doctest)
# else()
# CPMAddPackage("gh:doctest/[email protected]")
# endif()
# 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(
# NAME simpleini
# VERSION 4.19
# GITHUB_REPOSITORY brofield/simpleini
# )
# endif()
# Standalone packages not available anywhere else
# Include module path for packages that we need to find or build manually
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
# include(cmake/Findnewt.cmake)
# if(NOT TARGET newt)
# CPMFindPackage(NAME newt)
# endif()
endfunction()