aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-08-24 16:36:22 -0700
committerFuwn <[email protected]>2021-08-24 16:36:22 -0700
commit2f5629e80c5eca538bf27fb03032ad8d776ad4cc (patch)
tree4784bef405d11e20655e50b4476c7f250b5c18d3 /CMakeLists.txt
parentfeat(soyuz): log to file (diff)
downloadsoyuz-2f5629e80c5eca538bf27fb03032ad8d776ad4cc.tar.xz
soyuz-2f5629e80c5eca538bf27fb03032ad8d776ad4cc.zip
deps(soyuz): add fmtlib
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index afed754..a384fe1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,35 @@
cmake_minimum_required(VERSION 3.20)
project(soyuz)
+option(DOWNLOAD_EXTERNAL_DEPENDENCIES "Download external dependencies" ON)
+
+if (DOWNLOAD_EXTERNAL_DEPENDENCIES)
+ find_package(Git)
+ if (Git_FOUND)
+ include(build_tools/cmake/DownloadProject.cmake)
+
+ download_project(
+ PROJ fmt
+ GIT_REPOSITORY https://github.com/fmtlib/fmt.git
+ GIT_TAG master
+ SOURCE_DIR ${PROJECT_SOURCE_DIR}/deps/fmt
+ UPDATE_DISCONNECTED 1
+ )
+ else ()
+ string(CONCAT GIT_NOT_FOUND_WARNING
+ "Git was not found on your system: skipping downloading external dependencies"
+ "This will likely lead to Soyuz being unable to compile"
+ "Consider installing or fixing Git"
+ )
+ message(WARING GIT_NOT_FOUND_WARNING)
+ endif ()
+else ()
+ string(CONCAT DOWNLOAD_EXTERNAL_DEPENDENCIES_WARNING
+ "Skipping downloading external dependencies"
+ "This will likely lead to Soyuz being unable to compile"
+ "Consider turning DOWNLOAD_EXTERNAL_DEPENDENCIES ON"
+ )
+ message(WARING DOWNLOAD_EXTERNAL_DEPENDENCIES_WARNING)
+endif ()
+
add_subdirectory(${PROJECT_NAME})