2020-09-09 21:03:19 +00:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
|
|
|
|
project(abaddon)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2021-01-07 07:41:49 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
2020-09-09 21:03:19 +00:00
|
|
|
|
2021-01-07 07:41:49 +00:00
|
|
|
set(USE_TLS TRUE)
|
|
|
|
set(USE_OPEN_SSL TRUE)
|
2020-09-09 21:03:19 +00:00
|
|
|
|
2021-01-07 07:41:49 +00:00
|
|
|
find_package(nlohmann_json REQUIRED)
|
|
|
|
find_package(CURL)
|
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
find_package(SQLite3 REQUIRED)
|
|
|
|
find_package(gtkmm REQUIRED)
|
2020-10-12 22:17:53 +00:00
|
|
|
|
2021-01-07 07:41:49 +00:00
|
|
|
find_path(IXWEBSOCKET_INCLUDE_DIRS ixwebsocket/IXWebSocket.h)
|
|
|
|
find_library(IXWEBSOCKET_LIBRARY ixwebsocket)
|
|
|
|
if (NOT IXWEBSOCKET_LIBRARY)
|
|
|
|
add_subdirectory(thirdparty/IXWebSocket)
|
|
|
|
include_directories(IXWEBSOCKET_INCLUDE_DIRS)
|
2020-09-09 21:03:19 +00:00
|
|
|
endif()
|
|
|
|
|
2021-01-07 07:41:49 +00:00
|
|
|
include_directories(thirdparty/simpleini)
|
2020-12-11 02:32:02 +00:00
|
|
|
|
2021-01-07 07:41:49 +00:00
|
|
|
if(MINGW OR WIN32)
|
|
|
|
link_libraries(ws2_32)
|
2020-09-09 21:03:19 +00:00
|
|
|
endif()
|
|
|
|
|
2020-12-22 07:35:57 +00:00
|
|
|
if(WIN32)
|
|
|
|
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
2021-01-07 07:41:49 +00:00
|
|
|
add_compile_definitions(NOMINMAX)
|
2020-12-22 07:35:57 +00:00
|
|
|
endif()
|
|
|
|
|
2020-11-01 04:33:57 +00:00
|
|
|
file(GLOB ABADDON_SOURCES
|
|
|
|
"*.h"
|
|
|
|
"*.hpp"
|
|
|
|
"*.cpp"
|
|
|
|
"discord/*.hpp"
|
|
|
|
"discord/*.cpp"
|
|
|
|
"components/*.hpp"
|
|
|
|
"components/*.cpp"
|
|
|
|
"windows/*.hpp"
|
|
|
|
"windows/*.cpp"
|
2021-01-15 06:37:35 +00:00
|
|
|
"windows/guildsettings/*.hpp"
|
|
|
|
"windows/guildsettings/*.cpp"
|
2021-02-05 04:41:53 +00:00
|
|
|
"windows/profile/*.hpp"
|
|
|
|
"windows/profile/*.cpp"
|
2020-11-01 04:33:57 +00:00
|
|
|
"dialogs/*.hpp"
|
|
|
|
"dialogs/*.cpp"
|
2020-09-09 21:03:19 +00:00
|
|
|
)
|
2020-11-01 04:33:57 +00:00
|
|
|
|
|
|
|
add_executable(abaddon ${ABADDON_SOURCES})
|
2021-01-07 07:41:49 +00:00
|
|
|
target_include_directories(abaddon PUBLIC ${GTKMM_INCLUDE_DIRS})
|
|
|
|
target_include_directories(abaddon PUBLIC ${ZLIB_INCLUDE_DIRS})
|
|
|
|
target_include_directories(abaddon PUBLIC ${SQLite3_INCLUDE_DIRS})
|
2021-01-23 21:07:03 +00:00
|
|
|
target_include_directories(abaddon PUBLIC ${NLOHMANN_JSON_INCLUDE_DIRS})
|
2021-01-07 07:41:49 +00:00
|
|
|
|
|
|
|
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
|
|
|
|
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
|
|
|
|
((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_CXX_COMPILER_VERSION LESS 9))))
|
|
|
|
target_link_libraries(abaddon stdc++fs)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (IXWEBSOCKET_LIBRARY)
|
|
|
|
target_link_libraries(abaddon ${IXWEBSOCKET_LIBRARY})
|
|
|
|
find_library(MBEDTLS_X509_LIBRARY mbedx509)
|
|
|
|
find_library(MBEDTLS_TLS_LIBRARY mbedtls)
|
|
|
|
find_library(MBEDTLS_CRYPTO_LIBRARY mbedcrypto)
|
|
|
|
if (MBEDTLS_TLS_LIBRARY)
|
|
|
|
target_link_libraries(abaddon ${MBEDTLS_TLS_LIBRARY})
|
|
|
|
endif()
|
|
|
|
if (MBEDTLS_X509_LIBRARY)
|
|
|
|
target_link_libraries(abaddon ${MBEDTLS_X509_LIBRARY})
|
|
|
|
endif()
|
|
|
|
if (MBEDTLS_CRYPTO_LIBRARY)
|
|
|
|
target_link_libraries(abaddon ${MBEDTLS_CRYPTO_LIBRARY})
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
target_link_libraries(abaddon $<BUILD_INTERFACE:ixwebsocket>)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(Threads)
|
|
|
|
if (Threads_FOUND)
|
|
|
|
target_link_libraries(abaddon Threads::Threads)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_link_libraries(abaddon ${SQLite3_LIBRARIES})
|
|
|
|
target_link_libraries(abaddon ${GTKMM_LIBRARIES})
|
|
|
|
target_link_libraries(abaddon ${CURL_LIBRARIES})
|
2020-12-11 02:32:02 +00:00
|
|
|
target_link_libraries(abaddon ${ZLIB_LIBRARY})
|
2021-01-07 07:41:49 +00:00
|
|
|
target_link_libraries(abaddon ${NLOHMANN_JSON_LIBRARIES})
|