-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
90 lines (71 loc) · 2.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
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
cmake_minimum_required (VERSION 3.16)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
find_package(MySQL)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(BOT_NAME "beholder")
project(${BOT_NAME})
aux_source_directory("src" coresrc)
aux_source_directory("src/commands" coresrc)
aux_source_directory("src/3rdparty" coresrc)
aux_source_directory("src/proc" coresrc)
add_executable(${BOT_NAME} ${coresrc})
find_package(CxxUrl REQUIRED)
target_precompile_headers(${BOT_NAME} INTERFACE "src/3rdparty/httplib.h")
aux_source_directory("tessd" tessdsrc)
add_executable("tessd" ${tessdsrc} src/config.cpp src/3rdparty/httplib.cpp src/sentry.cpp)
string(ASCII 27 Esc)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set_target_properties(${BOT_NAME} PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
)
set_target_properties("tessd" PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
find_package(DPP REQUIRED)
if(APPLE)
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
find_package(OpenSSL REQUIRED)
else()
find_package(OpenSSL REQUIRED)
endif()
set(CMAKE_CXX_FLAGS "-g -O2 -Wall -Wno-unused-private-field -Wno-psabi -Wempty-body -Wignored-qualifiers -Wimplicit-fallthrough -Wmissing-field-initializers -Wsign-compare -Wtype-limits -Wuninitialized -Wshift-negative-value")
target_compile_definitions(${BOT_NAME} PUBLIC DPP_CORO=ON SPDLOG_FMT_EXTERNAL=ON CPPHTTPLIB_OPENSSL_SUPPORT)
target_compile_definitions("tessd" PUBLIC DPP_CORO=ON SPDLOG_FMT_EXTERNAL=ON CPPHTTPLIB_OPENSSL_SUPPORT)
target_include_directories(${BOT_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${DPP_INCLUDE_DIR}
)
target_include_directories("tessd" PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${DPP_INCLUDE_DIR}
)
target_link_libraries("tessd"
tesseract
leptonica
sentry
ssl
crypto
fmt
CxxUrl
${DPP_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
target_link_libraries(${BOT_NAME}
fmt
spdlog
mysqlclient
crypto
ssl
sentry
CxxUrl
${CMAKE_THREAD_LIBS_INIT}
${DPP_LIBRARIES}
)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
COMMAND "../sentry-symbols.sh"
)