From c011e491120a014c5fa4e25a3e4c07bbf087818d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Sat, 26 Feb 2022 21:42:09 +0100 Subject: [PATCH] Another fix --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bd59154..b1f0e9cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -320,8 +320,13 @@ if(NOT TARGET glm::glm) add_library(glm::glm ALIAS glm) endif() -add_subdirectory(lib/json) -find_package(nlohmann_json CONFIG REQUIRED) +find_package(nlohmann_json 3.10 QUIET) + +if(NOT nlohmann_json_FOUND) + message(STATUS "Using nlohmann_json git submodule") + set(JSON_BuildTests OFF CACHE INTERNAL "") + add_subdirectory(lib/json) +endif() set(Boost_USE_STATIC_LIBS ${BOOST_STATIC}) set(Boost_USE_MULTITHREADED ON)