-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.cmake.in
64 lines (58 loc) · 2.35 KB
/
config.cmake.in
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
@PACKAGE_INIT@
# Support both casing styles
list(APPEND HYDRA_COMPONENTS ${Hydra_FIND_COMPONENTS})
list(APPEND HYDRA_COMPONENTS ${hydra_FIND_COMPONENTS})
if(NOT HYDRA_COMPONENTS)
list(APPEND HYDRA_COMPONENTS httpclient)
# TODO: Make it work on Windows. Main challenge is that uSockets
# relies on libuv for that platform.
if(NOT WIN32)
list(APPEND HYDRA_COMPONENTS httpserver)
endif()
list(APPEND HYDRA_COMPONENTS bucket)
endif()
include(CMakeFindDependencyMacro)
# GCC does not allow the use of std::promise, std::future
# without compiling with pthreads support.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_dependency(Threads)
endif()
foreach(component ${HYDRA_COMPONENTS})
if(component STREQUAL "crypto")
find_dependency(BearSSL)
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_hydra_crypto.cmake")
elseif(component STREQUAL "httpclient")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_hydra_http.cmake")
find_dependency(ZLIB)
find_dependency(BearSSL)
find_dependency(CURL)
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_hydra_httpclient.cmake")
elseif(component STREQUAL "httpserver")
if(WIN32)
# TODO: Make it work on Windows. Main challenge is that uSockets
# relies on libuv for that platform.
message(FATAL_ERROR "Hydra does not support the HTTP Server module on Windows yet")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_hydra_http.cmake")
find_dependency(BearSSL)
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_hydra_crypto.cmake")
find_dependency(uSockets)
find_dependency(uWebSockets)
find_dependency(JSONToolkit COMPONENTS json)
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_hydra_httpserver.cmake")
elseif(component STREQUAL "bucket")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_hydra_http.cmake")
find_dependency(BearSSL)
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_hydra_crypto.cmake")
find_dependency(ZLIB)
find_dependency(CURL)
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_hydra_httpclient.cmake")
find_dependency(JSONToolkit COMPONENTS json uri)
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_hydra_bucket.cmake")
else()
message(FATAL_ERROR "Unknown Hydra component: ${component}")
endif()
endforeach()
check_required_components("@PROJECT_NAME@")