aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2023-04-02 15:29:11 -0400
committerCara Salter <cara@devcara.com>2023-04-02 15:29:11 -0400
commitb310afa5172b7bc4e5f9098255fcc57d28fd9c78 (patch)
treea7f996983c01cec40e670ed4f6750d1660d1f61f
parente63f88aa3f8fe1c0cf8366ee09188a4b18ede166 (diff)
download142bot-b310afa5172b7bc4e5f9098255fcc57d28fd9c78.tar.gz
142bot-b310afa5172b7bc4e5f9098255fcc57d28fd9c78.zip
Add dependencies to CMakeLists
-rw-r--r--CMakeLists.txt19
1 files changed, 17 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40edb5e..471adb7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,8 +13,19 @@ FetchContent_Declare(dpp
GIT_REPOSITORY https://github.com/brainboxdotcc/DPP
GIT_TAG v10.0.23
)
+
+FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
+ GIT_TAG 871ed52d350214a034f6ef8a3b8f51c5ce1bd400) # The commit hash for 1.9.0. Replace with the latest from: https://github.com/libcpr/cpr/releases
+
+FetchContent_Declare(fmt GIT_REPOSITORY https://github.com/fmtlib/fmt
+ GIT_TAG 9.1.0)
+
+FetchContent_Declare(spdlog
+ GIT_REPOSITORY https://github.com/gabime/spdlog
+ GIT_TAG v1.1.0
+ )
-FetchContent_MakeAvailable(clog dpp)
+FetchContent_MakeAvailable(clog dpp cpr fmt spdlog)
include(cmake/FindPCRE.cmake)
@@ -22,11 +33,14 @@ find_package(fmt)
string(ASCII 27 Esc)
+include(GNUInstallDirs)
aux_source_directory("src" coresrc)
add_executable(142bot ${coresrc})
include_directories("include")
-target_link_libraries(142bot clog dpp fmt spdlog pcre)
+target_link_libraries(142bot clog dpp fmt spdlog pcre cpr::cpr)
+
+install(TARGETS 142bot)
set (modules_dir "modules")
file(GLOB subdirlist ${modules_dir}/*)
@@ -36,5 +50,6 @@ foreach (fullmodname ${subdirlist})
set (modsrc "")
aux_source_directory(${modules_dir}/${modname} modsrc)
add_library(module_${modname} SHARED ${modsrc})
+ install(TARGETS module_${modname} RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/142bot/")
set_target_properties(module_${modname} PROPERTIES PREFIX "")
endforeach(fullmodname)