-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
40 lines (31 loc) · 1.08 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
CMAKE_MINIMUM_REQUIRED (VERSION 3.0)
PROJECT (alicebot)
OPTION (BUILD_TESTING OFF)
SET (SRC_DIR src)
SET (SOURCES
${SRC_DIR}/BotApiRequest.cpp
${SRC_DIR}/BotMessageObserver.cpp
${SRC_DIR}/BotClient.cpp
${SRC_DIR}/CurlRequest.cpp
# types
${SRC_DIR}/types/Message.cpp
${SRC_DIR}/types/User.cpp
${SRC_DIR}/types/File.cpp
${SRC_DIR}/types/PhotoSize.cpp
${SRC_DIR}/types/Chat.cpp
)
SET (CMAKE_CXX_STANDARD 17)
EXECUTE_PROCESS (COMMAND curl-config --libs OUTPUT_VARIABLE CURL_DEFINITIONS OUTPUT_STRIP_TRAILING_WHITESPACE)
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CURL_DEFINITIONS}")
SET (CMAKE_MACOSX_RPATH 1)
ADD_SUBDIRECTORY (thirdparty)
# add example to compile
ADD_SUBDIRECTORY (example)
ADD_LIBRARY(alicebot SHARED ${SOURCES})
TARGET_INCLUDE_DIRECTORIES (alicebot PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
TARGET_LINK_LIBRARIES (alicebot PRIVATE jsoncpp_static)
TARGET_LINK_LIBRARIES (alicebot PRIVATE libcurl)
IF (BUILD_TESTING)
ENABLE_TESTING ()
ADD_SUBDIRECTORY (tests)
ENDIF ()