-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
50 lines (40 loc) · 1.25 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.20)
# Project name
project(tikpp CXX)
set(MAIN_PROJECT_NAME ${PROJECT_NAME})
# Project options
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic")
endif()
# Thiry-party libraries
add_subdirectory(lib/fmt)
add_subdirectory(lib/googletest)
add_subdirectory(lib/openssl-cmake)
# Project files
set(SOURCE_FILES src/error.cpp
src/crypto.cpp
src/request.cpp
src/response.cpp)
include_directories(include/)
# Targets
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} fmt::fmt ssl crypto)
target_include_directories(${PROJECT_NAME} PUBLIC include)
set(SYSTEM_OPENSSL ON)
# Dependencies
find_package(Boost COMPONENTS system thread REQUIRED)
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
include_directories(${Boost_INCLUDE_DIR})
# OpenSSL
set(SYSTEM_OPENSSL ON)
if (WIN32)
link_directories(${OpenSSL_ROOT}/lib)
endif (WIN32)
# Testing (on *NIX operating systems only at the moment)
if (UNIX)
enable_testing()
add_subdirectory(tests)
endif (UNIX)