2024-01-02 03:45:06 +01:00
|
|
|
#[[**************************************************************************
|
|
|
|
* dtranslatebot Discord Translate Bot
|
|
|
|
* Copyright (C) 2023-2024 Syping
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
* are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* This software is provided as-is, no warranties are given to you, we are not
|
|
|
|
* responsible for anything with use of the software, you are self responsible.
|
|
|
|
****************************************************************************]]
|
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2024-01-18 16:09:25 +01:00
|
|
|
project(dtranslatebot VERSION 0.1 LANGUAGES CXX)
|
|
|
|
include(GNUInstallDirs)
|
2024-01-02 03:45:06 +01:00
|
|
|
|
2024-01-18 16:09:25 +01:00
|
|
|
# dtranslatebot Source files
|
|
|
|
set(DTRANSLATEBOT_HEADERS
|
2024-02-05 16:36:51 +01:00
|
|
|
src/database_core.h
|
2024-02-06 16:19:08 +01:00
|
|
|
src/database_file.h
|
2024-01-18 16:09:25 +01:00
|
|
|
src/message_queue.h
|
|
|
|
src/settings.h
|
2024-02-06 16:19:08 +01:00
|
|
|
src/settings_types.h
|
2024-02-03 07:16:12 +01:00
|
|
|
src/slashcommands.h
|
2024-01-18 16:09:25 +01:00
|
|
|
src/submit_queue.h
|
2024-02-04 07:10:02 +01:00
|
|
|
src/translator_core.h
|
|
|
|
src/translator_libretranslate.h
|
2024-01-18 16:09:25 +01:00
|
|
|
src/webhook_push.h
|
|
|
|
)
|
|
|
|
set(DTRANSLATEBOT_SOURCES
|
2024-02-05 16:36:51 +01:00
|
|
|
src/database_core.cpp
|
2024-02-06 16:19:08 +01:00
|
|
|
src/database_file.cpp
|
2024-01-02 03:45:06 +01:00
|
|
|
src/main.cpp
|
2024-01-11 21:49:01 +01:00
|
|
|
src/message_queue.cpp
|
2024-01-02 03:45:06 +01:00
|
|
|
src/settings.cpp
|
2024-02-03 07:16:12 +01:00
|
|
|
src/slashcommands.cpp
|
2024-01-12 12:53:16 +01:00
|
|
|
src/submit_queue.cpp
|
2024-02-04 07:10:02 +01:00
|
|
|
src/translator_core.cpp
|
|
|
|
src/translator_libretranslate.cpp
|
2024-01-17 12:38:16 +01:00
|
|
|
src/webhook_push.cpp
|
2024-01-02 03:45:06 +01:00
|
|
|
)
|
|
|
|
|
2024-01-18 16:09:25 +01:00
|
|
|
# dtranslatebot Module Path
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
2024-01-02 03:45:06 +01:00
|
|
|
|
2024-01-18 16:09:25 +01:00
|
|
|
# D++ Discord API Library for Bots
|
|
|
|
find_package(DPP REQUIRED)
|
2024-01-02 03:45:06 +01:00
|
|
|
|
2024-01-18 16:09:25 +01:00
|
|
|
# pthread Support
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
2024-01-02 03:45:06 +01:00
|
|
|
|
2024-01-18 16:09:25 +01:00
|
|
|
# dtranslatebot Target + Installs
|
|
|
|
add_executable(dtranslatebot ${DTRANSLATEBOT_HEADERS} ${DTRANSLATEBOT_SOURCES})
|
2024-02-06 16:19:08 +01:00
|
|
|
target_link_libraries(dtranslatebot PRIVATE Threads::Threads ${DPP_LIBRARIES})
|
2024-01-18 16:09:25 +01:00
|
|
|
target_include_directories(dtranslatebot PRIVATE ${DPP_INCLUDE_DIR})
|
|
|
|
set_target_properties(dtranslatebot PROPERTIES
|
2024-01-02 03:45:06 +01:00
|
|
|
CXX_STANDARD 17
|
|
|
|
CXX_STANDARD_REQUIRED ON
|
|
|
|
)
|
2024-01-18 16:09:25 +01:00
|
|
|
install(TARGETS dtranslatebot DESTINATION "${CMAKE_INSTALL_BINDIR}")
|