-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
61 lines (52 loc) · 1.75 KB
/
CMakeLists.txt
File metadata and controls
61 lines (52 loc) · 1.75 KB
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
cmake_minimum_required(VERSION 3.8...4.2)
project(boost_redis VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
# Library
add_library(boost_redis INTERFACE)
add_library(Boost::redis ALIAS boost_redis)
target_include_directories(boost_redis INTERFACE include)
target_compile_features(boost_redis INTERFACE cxx_std_17)
# Dependencies
# Boost dependencies should be already available.
# If other dependencies are not found, we bail out
find_package(Threads)
if(NOT Threads_FOUND)
message(STATUS "Boost.Redis has been disabled, because the required package Threads hasn't been found")
return()
endif()
find_package(OpenSSL)
if(NOT OpenSSL_FOUND)
message(STATUS "Boost.Redis has been disabled, because the required package OpenSSL hasn't been found")
return()
endif()
# This is generated by boostdep
target_link_libraries(boost_redis
INTERFACE
Boost::asio
Boost::assert
Boost::core
Boost::mp11
Boost::system
Boost::throw_exception
Threads::Threads
OpenSSL::Crypto
OpenSSL::SSL
)
# Don't run integration testing unless explicitly requested, since these require a running server
option(BOOST_REDIS_INTEGRATION_TESTS OFF "Whether to build and run integration tests or not")
mark_as_advanced(BOOST_REDIS_INTEGRATION_TESTS)
# Examples and tests
if(BUILD_TESTING)
# Custom target tests; required by the Boost superproject
if(NOT TARGET tests)
add_custom_target(tests)
endif()
# Tests and common utilities
add_subdirectory(test)
if (BOOST_REDIS_INTEGRATION_TESTS)
# Benchmarks. Build them with tests to prevent code rotting.
# Guarded to prevent them from building in normal builds
add_subdirectory(benchmarks)
# Examples. All of them require a real server running
add_subdirectory(example)
endif()
endif()