-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
56 lines (39 loc) · 1.6 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
51
52
53
54
55
56
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
project(tdlpp VERSION 0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_THREAD_PREFER_PTHREAD ON)
option(TDLPP_BUILD_SAMPLES "Build tdl++ samples" ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake/find
)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
##################################################################################################################
## Resolve dependencies
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies.cmake)
message(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies.cmake)
# Generate bindings header
add_subdirectory(binding)
##################################################################################################################
## Build library
add_library(${CMAKE_PROJECT_NAME}
tdlpp/tdlpp.hpp
tdlpp/auth/DefaultAuth.cpp
tdlpp/router/Router.cpp
tdlpp/poll/LongPoll.cpp
tdlpp/base/Handler.cpp
tdlpp/base/UpdateCalbacksHandler.cpp
${TDLPP_BINDING_HEADER}
)
add_dependencies(${CMAKE_PROJECT_NAME} binding_generator binding_generator_header)
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${CMAKE_BINARY_DIR} ./)
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC Td::TdStatic plog::plog)
##################################################################################################################
## Build samples
if (TDLPP_BUILD_SAMPLES)
add_subdirectory(samples)
endif()