|
|
|
@ -4,39 +4,27 @@ cmake_minimum_required(VERSION 3.17.0)
@@ -4,39 +4,27 @@ cmake_minimum_required(VERSION 3.17.0)
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17) |
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
|
|
|
|
|
|
|
|
|
set(CMAKE_BUILD_TYPE "Debug") |
|
|
|
|
|
|
|
|
|
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") |
|
|
|
|
#set(BUILD_SHARED_LIBS OFF) |
|
|
|
|
#set(CMAKE_EXE_LINKER_FLAGS "-static") |
|
|
|
|
|
|
|
|
|
set (CMAKE_CXX_FLAGS" ${CMAKE_CXX_FLAGS_DEBUG} -static-libasan -g") |
|
|
|
|
set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS_DEBUG} -static-libasan") |
|
|
|
|
set(CMAKE_BUILD_TYPE "Debug") |
|
|
|
|
|
|
|
|
|
set (CMAKE_CXX_FLAGS" ${CMAKE_CXX_FLAGS} -DSPDLOG_COMPILED_LIB -DSQLITE_OMIT_LOAD_EXTENSION -static-libasan -g") |
|
|
|
|
set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -DSPDLOG_COMPILED_LIB -DSQLITE_OMIT_LOAD_EXTENSION -static-libasan") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include(FetchContent) |
|
|
|
|
FetchContent_Declare(json |
|
|
|
|
GIT_REPOSITORY https://github.com/nlohmann/json.git |
|
|
|
|
GIT_TAG v3.7.3) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FetchContent_GetProperties(json) |
|
|
|
|
if(NOT json_POPULATED) |
|
|
|
|
FetchContent_Populate(json) |
|
|
|
|
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FetchContent_Declare(spdlog |
|
|
|
|
GIT_REPOSITORY https://github.com/gabime/spdlog |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
FetchContent_GetProperties(spdlog) |
|
|
|
|
if(NOT spdlog_POPULATED) |
|
|
|
|
FetchContent_Populate(spdlog) |
|
|
|
|
add_subdirectory(${spdlog_SOURCE_DIR} ${spdlog_BINARY_DIR} EXCLUDE_FROM_ALL) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/whoshuu/cpr.git GIT_TAG c8d33915dbd88ad6c92b258869b03aba06587ff9) # the commit hash for 1.5.0 |
|
|
|
|
FetchContent_MakeAvailable(cpr) |
|
|
|
|
|
|
|
|
@ -44,24 +32,27 @@ project(echobot-submodule)
@@ -44,24 +32,27 @@ project(echobot-submodule)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") |
|
|
|
|
set(Boost_USE_MULTITHREADED ON) |
|
|
|
|
set (OPENSSL_USE_STATIC_LIBS TRUE) |
|
|
|
|
|
|
|
|
|
find_package(spdlog REQUIRED) |
|
|
|
|
find_package(SQLite3 REQUIRED) |
|
|
|
|
find_package(Threads REQUIRED) |
|
|
|
|
find_package(OpenSSL REQUIRED) |
|
|
|
|
find_package(Boost COMPONENTS system REQUIRED) |
|
|
|
|
include_directories(/usr/local/include ${OPENSSL_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) |
|
|
|
|
include_directories(/usr/local/include ${OPENSSL_INCLUDE_DIR} |
|
|
|
|
${Boost_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/spdlog/include |
|
|
|
|
${CMAKE_SOURCE_DIR}/tgbot-cpp/include) |
|
|
|
|
|
|
|
|
|
add_subdirectory(tgbot-cpp) |
|
|
|
|
if (CURL_FOUND) |
|
|
|
|
include_directories(${CURL_INCLUDE_DIRS}) |
|
|
|
|
add_definitions(-DHAVE_CURL) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
add_executable(telegram_bog telegram_bot.cpp sqlite3.c) |
|
|
|
|
|
|
|
|
|
add_executable(telegram_bog telegram_bot.cpp) |
|
|
|
|
#set(OPENSSL_USE_STATIC_LIBS TRUE) |
|
|
|
|
|
|
|
|
|
target_link_libraries(telegram_bog PRIVATE TgBot ${CMAKE_THREAD_LIBS_INIT} |
|
|
|
|
target_link_libraries(telegram_bog PRIVATE |
|
|
|
|
${CMAKE_SOURCE_DIR}/tgbot-cpp/build/libTgBot.a ${CMAKE_THREAD_LIBS_INIT} |
|
|
|
|
${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES}) |
|
|
|
|
target_link_libraries(telegram_bog PRIVATE nlohmann_json::nlohmann_json) |
|
|
|
|
target_link_libraries(telegram_bog PRIVATE cpr::cpr) |
|
|
|
|
target_link_libraries(telegram_bog PRIVATE sqlite3) |
|
|
|
|
target_link_libraries(telegram_bog PRIVATE spdlog::spdlog) |
|
|
|
|
target_link_libraries(telegram_bog PRIVATE ${CMAKE_SOURCE_DIR}/spdlog/build/libspdlog.a) |
|
|
|
|
|
|
|
|
|