63 lines
1.4 KiB
CMake
63 lines
1.4 KiB
CMake
cmake_minimum_required(VERSION 3.25)
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
project(xbot
|
|
VERSION 1
|
|
LANGUAGES CXX
|
|
)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
pkg_check_modules(LIBHS libhs REQUIRED IMPORTED_TARGET)
|
|
|
|
set(BOOST_INCLUDE_LIBRARIES asio log signals2 endian)
|
|
set(BOOST_ENABLE_CMAKE ON)
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
Boost
|
|
URL https://github.com/boostorg/boost/releases/download/boost-1.87.0/boost-1.87.0-cmake.tar.xz
|
|
URL_HASH SHA1=4ec86f884ffb57ce7f6a6c6eb05b1af247aba0ac
|
|
)
|
|
FetchContent_Declare(
|
|
tomlplusplus
|
|
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
|
|
GIT_TAG v3.4.0
|
|
)
|
|
FetchContent_MakeAvailable(tomlplusplus)
|
|
FetchContent_MakeAvailable(Boost)
|
|
|
|
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_subdirectory(mybase64)
|
|
add_subdirectory(mysocks5)
|
|
|
|
add_executable(xbot
|
|
main.cpp
|
|
irc_commands.inc
|
|
bot.cpp
|
|
connection.cpp
|
|
irc_coroutine.cpp
|
|
ircmsg.cpp
|
|
registration.cpp
|
|
sasl_mechanism.cpp
|
|
client.cpp
|
|
settings.cpp
|
|
snote.cpp
|
|
)
|
|
|
|
target_include_directories(xbot PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
target_link_libraries(xbot PRIVATE
|
|
OpenSSL::SSL
|
|
Boost::signals2 Boost::log Boost::asio
|
|
tomlplusplus_tomlplusplus
|
|
PkgConfig::LIBHS
|
|
mysocks5 mybase64)
|