43 lines
1.1 KiB
CMake
43 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.13)
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
project(xbot
|
|
VERSION 1
|
|
LANGUAGES C CXX
|
|
)
|
|
|
|
find_package(Boost REQUIRED)
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
tomlplusplus
|
|
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
|
|
GIT_TAG v3.4.0
|
|
)
|
|
FetchContent_MakeAvailable(tomlplusplus)
|
|
|
|
FetchContent_Declare(
|
|
eventpp
|
|
GIT_REPOSITORY https://github.com/wqking/eventpp.git
|
|
GIT_TAG v0.1.3
|
|
)
|
|
FetchContent_MakeAvailable(eventpp)
|
|
|
|
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)
|
|
|
|
add_executable(xbot
|
|
main.cpp irc_commands.inc ircmsg.cpp settings.cpp connection.cpp
|
|
thread.cpp snote_thread.cpp watchdog_thread.cpp write_irc.cpp
|
|
ping_thread.cpp irc_parse_thread.cpp registration_thread.cpp
|
|
self_thread.cpp)
|
|
target_include_directories(xbot PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
target_link_libraries(xbot PRIVATE Boost::headers tomlplusplus_tomlplusplus eventpp)
|