|
|
|
@ -1,13 +1,17 @@
@@ -1,13 +1,17 @@
|
|
|
|
|
project(telegram_bog) |
|
|
|
|
cmake_minimum_required(VERSION 3.17.0) |
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17) |
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON) |
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF) |
|
|
|
|
|
|
|
|
|
set(CMAKE_BUILD_TYPE "Debug") |
|
|
|
|
|
|
|
|
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -fno-omit-frame-pointer -fsanitize=address") |
|
|
|
|
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") |
|
|
|
|
#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") |
|
|
|
|
|
|
|
|
|
include(FetchContent) |
|
|
|
|
FetchContent_Declare(json |
|
|
|
@ -21,37 +25,43 @@ if(NOT json_POPULATED)
@@ -21,37 +25,43 @@ if(NOT json_POPULATED)
|
|
|
|
|
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
FetchContent_Declare(spotify |
|
|
|
|
GIT_REPOSITORY https://github.com/smaltby/spotify-api-plusplus.git) |
|
|
|
|
FetchContent_GetProperties(spotify) |
|
|
|
|
FetchContent_Populate(spotify) |
|
|
|
|
|
|
|
|
|
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) |
|
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.8.4) |
|
|
|
|
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(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(spdlog/include/) |
|
|
|
|
|
|
|
|
|
add_subdirectory(tgbot-cpp) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_executable(telegram_bog telegram_bot.cpp) |
|
|
|
|
|
|
|
|
|
target_link_libraries(telegram_bog PRIVATE TgBot ${CMAKE_THREAD_LIBS_INIT} |
|
|
|
|
${OPENSSL_LIBRARIES} ${Boost_LIBRARIES} ${CURL_LIBRARIES} |
|
|
|
|
nlohmann_json::nlohmann_json) |
|
|
|
|
${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 sqlite3) |
|
|
|
|
target_link_libraries(telegram_bog PRIVATE sqlite3) |
|
|
|
|
target_link_libraries(telegram_bog PRIVATE spdlog::spdlog) |
|
|
|
|
|
|
|
|
|