-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
144 lines (125 loc) · 4.04 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
cmake_minimum_required(VERSION 3.4)
set (CMAKE_CXX_STANDARD 17)
project(TG_SayStickerBot)
# set(CMAKE_CXX_FLAGS "-g")
# sources
aux_source_directory(./src SRC_LIST)
# libs
## threads
find_package(Threads REQUIRED)
# zlib
find_package(ZLIB REQUIRED)
## openssl
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
## curl
find_package(CURL)
if (CURL_FOUND)
include_directories(${CURL_INCLUDE_DIRS})
add_definitions(-DHAVE_CURL)
endif()
## boost
set(Boost_USE_MULTITHREADED ON)
if (ENABLE_TESTS)
find_package(Boost 1.59.0 COMPONENTS system unit_test_framework REQUIRED)
else()
find_package(Boost 1.59.0 COMPONENTS system REQUIRED)
endif()
include_directories(${Boost_INCLUDE_DIR})
## local
include_directories("/usr/local/include")
link_directories("/usr/local/lib")
## cairo
include(FindPkgConfig)
pkg_check_modules(CAIRO cairo)
if (NOT CAIRO_FOUND)
message(FATAL_ERROR "Cairo not found!")
endif ()
message(STATUS "Cairo library status:")
message(STATUS " version: ${CAIRO_VERSION}")
message(STATUS " include path: ${CAIRO_INCLUDE_DIRS}")
message(STATUS " lib path: ${CAIRO_LIBDIR}")
message(STATUS " libraries: ${CAIRO_LIBRARIES}")
include_directories(${CAIRO_INCLUDE_DIRS})
link_directories(${CAIRO_LIBDIR})
## pango
pkg_check_modules(PANGO pangocairo)
if (NOT CAIRO_FOUND)
message(FATAL_ERROR "Pango not found!")
endif ()
message(STATUS "Pango library status:")
message(STATUS " version: ${PANGO_VERSION}")
message(STATUS " include path: ${PANGO_INCLUDE_DIRS}")
message(STATUS " lib path: ${PANGO_LIBDIR}")
message(STATUS " libs path: ${PANGO_LIBRARY_DIRS}")
message(STATUS " libraries: ${PANGO_LIBRARIES}")
include_directories(${PANGO_INCLUDE_DIRS})
link_directories(${PANGO_LIBDIR})
link_directories(${PANGO_LIBRARY_DIRS})
## rsvg
pkg_check_modules(RSVG librsvg-2.0)
if (NOT RSVG_FOUND)
message(FATAL_ERROR "rsvg not found!")
endif ()
message(STATUS "rsvg library status:")
message(STATUS " version: ${RSVG_VERSION}")
message(STATUS " include path: ${RSVG_INCLUDE_DIRS}")
message(STATUS " lib path: ${RSVG_LIBDIR}")
message(STATUS " libs path: ${RSVG_LIBRARY_DIRS}")
message(STATUS " libraries: ${RSVG_LIBRARIES}")
include_directories(${RSVG_INCLUDE_DIRS})
link_directories(${RSVG_LIBDIR})
link_directories(${RSVG_LIBRARY_DIRS})
## OpenCV
find_package(OpenCV REQUIRED)
message(STATUS "OpenCV library status:")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
message(STATUS " libraries: ${OpenCV_LIBS}")
include_directories(${OpenCV_INCLUDE_DIRS})
## libwebp
pkg_check_modules(WEBP libwebp)
if (NOT WEBP_FOUND)
message(FATAL_ERROR "libwebp not found!")
endif ()
message(STATUS "libwebp library status:")
message(STATUS " version: ${WEBP_VERSION}")
message(STATUS " include path: ${WEBP_INCLUDE_DIRS}")
message(STATUS " lib path: ${WEBP_LIBDIR}")
message(STATUS " libraries: ${WEBP_LIBRARIES}")
include_directories(${WEBP_INCLUDE_DIRS})
link_directories(${WEBP_LIBDIR})
## SQLite3
find_package(SQLite3)
if (NOT SQLite3_FOUND)
pkg_check_modules(SQLite3 sqlite3)
if (NOT SQLite3_FOUND)
message(FATAL_ERROR "SQLite3 not found!")
endif ()
endif ()
message(STATUS "SQLite3 library status:")
message(STATUS " version: ${SQLite3_VERSION}")
message(STATUS " include path: ${SQLite3_INCLUDE_DIRS}")
message(STATUS " libraries: ${SQLite3_LIBRARIES}")
include_directories(${SQLite3_INCLUDE_DIRS})
set(LIB_LIST
${CMAKE_THREAD_LIBS_INIT}
${ZLIB_LIBRARIES}
${OPENSSL_LIBRARIES}
${Boost_LIBRARIES}
${CURL_LIBRARIES}
TgBot
${CAIRO_LIBRARIES}
${PANGO_LIBRARIES}
${RSVG_LIBRARIES}
${OpenCV_LIBS}
${WEBP_LIBRARIES}
ArtRobot
${SQLite3_LIBRARIES}
)
# building project
add_executable(${PROJECT_NAME} ${SRC_LIST})
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_link_libraries(${PROJECT_NAME} ${LIB_LIST})
configure_file(picture/SaySticker2_messageX.png SaySticker2_messageX.png COPYONLY)
configure_file(picture/SaySticker2_userPhotoMask.png SaySticker2_userPhotoMask.png COPYONLY)