This repository has been archived by the owner on Oct 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dependencies.cmake
164 lines (137 loc) · 5.53 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Copyright (c) 2019 Denis Trofimov ([email protected])
# Distributed under the MIT License.
# See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT
find_package( Threads REQUIRED )
message(STATUS "CMAKE_THREAD_LIBS_INIT = ${CMAKE_THREAD_LIBS_INIT}")
# This project needs cling.
if(ENABLE_CLING)
find_package(Cling REQUIRED)
endif(ENABLE_CLING)
if(BUILD_EXAMPLES)
find_package(CXTPL_tool REQUIRED)
endif(BUILD_EXAMPLES)
#
# If you have built boost statically you will need to set the Boost_USE_STATIC_LIBS CMake variable to ON
# also don`t forget to set DBOOST_LOG_DYN_LINK https://stackoverflow.com/a/17868918/10904212
# set( Boost_USE_STATIC_LIBS FALSE )
# set( Boost_USE_STATIC_RUNTIME FALSE )
# set( Boost_USE_MULTITHREADED TRUE )
#set( BOOST_ROOT CACHE STRING /usr )
#set( Boost_ADDITIONAL_VERSIONS "1.62 1.63 1.64 1.65 1.66 1.67 1.68 1.69" )
#set( BOOST_LIBS CACHE STRING ${BOOST_ROOT}/lib )
# set( Boost_COMPILER "-gcc" )
#find_package( Boost
# COMPONENTS
# coroutine
# fiber
# context
# filesystem
# program_options
# regex
# system
# thread
# REQUIRED )
#message("Found Boost ${Boost_LIBRARY_DIRS} ${Boost_LIB_VERSION}")
#if(Boost_VERSION GREATER_EQUAL 107100)
# add_definitions(-DBOOST_BEAST_SEPARATE_COMPILATION -DBOOST_ASIO_SEPARATE_COMPILATION)
#endif()
#find_package( Boost 1.71.0
# COMPONENTS program_options filesystem regex date_time system thread graph
# EXACT REQUIRED )
#if(NOT TARGET CONAN_PKG::boost)
# message(FATAL_ERROR "Use boost from conan")
#endif()
#message(STATUS "Boost_LIBRARIES=${Boost_LIBRARIES}")
#message(STATUS "Boost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}")
if(NOT TARGET CONAN_PKG::clang_folly_conan)
message(FATAL_ERROR "Use clang_folly_conan from conan")
endif()
if(NOT TARGET CONAN_PKG::chromium_base)
message(FATAL_ERROR "Use chromium_base from conan")
endif()
if(NOT TARGET CONAN_PKG::chromium_build_util)
message(FATAL_ERROR "Use chromium_build_util from conan")
endif()
find_package(chromium_build_util REQUIRED)
#
if(TARGET chromium_build_util::chromium_build_util-static)
set(build_util_LIB "chromium_build_util::chromium_build_util-static")
else()
message(FATAL_ERROR "not supported: using system provided chromium_build_util library")
endif()
find_package(chromium_base REQUIRED)
if(TARGET chromium_base::chromium_base-static)
set(base_LIB chromium_base::chromium_base-static)
else()
message(FATAL_ERROR "not supported: using system provided chromium_base library")
endif()
set(WITH_TESTSUITE OFF CACHE BOOL "" FORCE) # disable what you don't use
#add_subdirectory(corrade EXCLUDE_FROM_ALL) # so only things you use are built
# see https://doc.magnum.graphics/corrade/corrade-cmake.html#corrade-cmake-subproject
find_package(Corrade REQUIRED PluginManager)
if(NOT TARGET CONAN_PKG::corrade)
message(FATAL_ERROR "Use corrade from conan")
endif()
add_library( boost_outcome INTERFACE )
target_include_directories( boost_outcome SYSTEM INTERFACE "submodules/boost.outcome/include" )
get_target_property (BOOST_OUTCOME_IMPORTED_LOCATION boost_outcome INTERFACE_INCLUDE_DIRECTORIES)
message( STATUS "boost_outcome=${BOOST_OUTCOME_IMPORTED_LOCATION}" )
add_library(microsoft_gsl INTERFACE)
target_include_directories(microsoft_gsl SYSTEM INTERFACE "submodules/GSL/include")
get_target_property (microsoft_gsl_IMPORTED_LOCATION microsoft_gsl INTERFACE_INCLUDE_DIRECTORIES)
message( STATUS "microsoft_gsl=${microsoft_gsl_IMPORTED_LOCATION}" )
#if(USE_FOLLY)
# #find_package( Folly REQUIRED )
# #message( STATUS "FOLLY_LIBRARIES=${FOLLY_LIBRARIES}")
# #message( STATUS "FOLLY_INCLUDE_DIR=${FOLLY_INCLUDE_DIR}")
#
# find_package(Libiberty REQUIRED) # used by folly
# #get_target_property (Libiberty_LOCATION Libiberty INTERFACE_INCLUDE_DIRECTORIES)
# message( STATUS "LIBIBERTY_INCLUDE_DIR=${LIBIBERTY_INCLUDE_DIR}")
# message( STATUS "LIBIBERTY_LIBRARY=${LIBIBERTY_LIBRARY}")
#endif()
find_package( X11 REQUIRED )
message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}")
find_package( EXPAT REQUIRED )
message(STATUS "EXPAT_LIBRARIES = ${EXPAT_LIBRARIES}")
find_package( ZLIB REQUIRED )
message(STATUS "ZLIB_LIBRARIES = ${ZLIB_LIBRARIES}")
message(STATUS "CMAKE_DL_LIBS = ${CMAKE_DL_LIBS}")
if(USE_RANG)
set(RANG_FIND_REQUIRED
TRUE CACHE BOOL
"RANG_FIND_REQUIRED")
find_package(Rang REQUIRED)
message(STATUS "RANG found at ${RANG_INCLUDE_DIR}")
else()
message(WARNING "RANG turned off!")
endif()
#find_package(libunwind REQUIRED)
#message(STATUS "LIBUNWIND_LIBRARIES=${LIBUNWIND_LIBRARIES}")
#message(STATUS "LIBUNWIND_INCLUDE_DIR=${LIBUNWIND_INCLUDE_DIR}")
#
#find_package(LibLZMA REQUIRED)
#message(STATUS "LIBLZMA_INCLUDE_DIRS=${LIBLZMA_INCLUDE_DIRS}")
#message(STATUS "LIBLZMA_LIBRARIES=${LIBLZMA_LIBRARIES}")
#if(USE_G3LOG)
# set(G3LOG_FIND_REQUIRED
# TRUE CACHE BOOL
# "G3LOG_FIND_REQUIRED")
# find_package(g3log REQUIRED)
# message(STATUS "g3log logger found at ${G3LOG_LIBRARIES} AND ${G3LOG_INCLUDE_DIR}")
#else()
# message(WARNING "g3log logger turned off!")
#endif()
#find_package(Gflags REQUIRED)
#message(STATUS "LIBGFLAGS_LIBRARY=${LIBGFLAGS_LIBRARY}")
#message(STATUS "LIBGFLAGS_INCLUDE_DIR=${LIBGFLAGS_INCLUDE_DIR}")
#find_package(LZ4 REQUIRED)
#message(STATUS "LZ4_LIBRARY_RELEASE=${LZ4_LIBRARY_RELEASE}")
#message(STATUS "LZ4_INCLUDE_DIR=${LZ4_INCLUDE_DIR}")
#
#find_package(DoubleConversion MODULE REQUIRED)
#message(STATUS "LIBLZMA_INCLUDE_DIRS=${DOUBLE_CONVERSION_LIBRARY}")
#message(STATUS "LIBLZMA_LIBRARIES=${DOUBLE_CONVERSION_INCLUDE_DIR}")
#find_package(LibEvent REQUIRED)
#message(STATUS "LZ4_LIBRARY=${LZ4_LIBRARY}")
#message(STATUS "LZ4_LIBRARY_DEBUG=${LZ4_LIBRARY_DEBUG}")