summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2022-01-20 20:18:47 -0800
committertheo3 <arisstephenson2@gmail.com>2022-01-20 21:01:17 -0800
commit3f266d91a65db989d5df8a7dab0d4d576ecefdf8 (patch)
treead352e5c9cd997b7303dc36a9130996cc1ea7804 /tools
parent79d8d25be2f1391e289f98cd9bf2060727502126 (diff)
lower required cmake version
Diffstat (limited to 'tools')
-rw-r--r--tools/CMakeLists.txt23
1 files changed, 21 insertions, 2 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 7ec9209b..b0c36901 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.14)
+cmake_minimum_required(VERSION 3.13)
project(tools)
include(FetchContent)
@@ -31,7 +31,26 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/CLIUtils/CLI11
GIT_TAG v2.1.2
)
-FetchContent_MakeAvailable(json fmt cli11)
+
+if (${CMAKE_VERSION} VERSION_LESS "3.14")
+FetchContent_GetProperties(json)
+FetchContent_GetProperties(fmt)
+FetchContent_GetProperties(cli11)
+ if (NOT json_POPULATED)
+ FetchContent_Populate(json)
+ add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR})
+ endif()
+ if (NOT fmt_POPULATED)
+ FetchContent_Populate(fmt)
+ add_subdirectory(${fmt_SOURCE_DIR} ${fmt_BINARY_DIR})
+ endif()
+ if (NOT cli11_POPULATED)
+ FetchContent_Populate(cli11)
+ add_subdirectory(${cli11_SOURCE_DIR} ${cli11_BINARY_DIR})
+ endif()
+else()
+ FetchContent_MakeAvailable(json fmt cli11)
+endif()
add_library(filesystem INTERFACE)
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")