2023-11-22 19:59:34 -08:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
project(xbot
|
|
|
|
VERSION 1
|
|
|
|
LANGUAGES C CXX
|
|
|
|
)
|
|
|
|
|
2023-11-29 13:13:48 -08:00
|
|
|
find_package(Boost REQUIRED COMPONENTS log)
|
2023-11-26 21:16:56 -08:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
|
|
|
pkg_check_modules(LIBHS libhs REQUIRED IMPORTED_TARGET)
|
|
|
|
|
2023-11-22 19:59:34 -08:00
|
|
|
include(FetchContent)
|
2023-11-25 20:09:20 -08:00
|
|
|
|
2023-11-22 19:59:34 -08:00
|
|
|
FetchContent_Declare(
|
|
|
|
tomlplusplus
|
|
|
|
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
|
|
|
|
GIT_TAG v3.4.0
|
|
|
|
)
|
|
|
|
FetchContent_MakeAvailable(tomlplusplus)
|
|
|
|
|
2023-11-25 20:09:20 -08:00
|
|
|
FetchContent_Declare(
|
|
|
|
eventpp
|
|
|
|
GIT_REPOSITORY https://github.com/wqking/eventpp.git
|
|
|
|
GIT_TAG v0.1.3
|
|
|
|
)
|
|
|
|
FetchContent_MakeAvailable(eventpp)
|
|
|
|
|
2023-11-26 15:08:55 -08:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT irc_commands.inc
|
|
|
|
COMMAND
|
|
|
|
gperf
|
|
|
|
-C -Z IrcCommandHash -K text -L C++ -t
|
|
|
|
--output-file irc_commands.inc
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/irc_commands.gperf
|
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/irc_commands.gperf
|
|
|
|
VERBATIM)
|
|
|
|
|
2023-11-26 16:48:21 -08:00
|
|
|
add_executable(xbot
|
|
|
|
main.cpp irc_commands.inc ircmsg.cpp settings.cpp connection.cpp
|
2023-11-27 14:12:20 -08:00
|
|
|
snote_thread.cpp watchdog_thread.cpp write_irc.cpp
|
2023-11-26 16:48:21 -08:00
|
|
|
ping_thread.cpp irc_parse_thread.cpp registration_thread.cpp
|
2023-11-29 08:56:58 -08:00
|
|
|
self_thread.cpp command_thread.cpp priv_thread.cpp)
|
2023-11-26 15:08:55 -08:00
|
|
|
target_include_directories(xbot PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
2023-11-29 13:13:48 -08:00
|
|
|
target_link_libraries(xbot PRIVATE Boost::log Boost::headers tomlplusplus_tomlplusplus eventpp PkgConfig::LIBHS)
|