From 8c750414c5f6410f304a847cdfc1fa585f984044 Mon Sep 17 00:00:00 2001 From: Cengizhan Pasaoglu Date: Wed, 3 May 2023 21:23:56 +0300 Subject: [PATCH] Fix if JSON library already added another CMake target (#2126) --- cmake/nlohmann-json.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/nlohmann-json.cmake b/cmake/nlohmann-json.cmake index 84f107b97c..d56a6cbb6d 100644 --- a/cmake/nlohmann-json.cmake +++ b/cmake/nlohmann-json.cmake @@ -33,6 +33,8 @@ find_package(nlohmann_json QUIET) set(nlohmann_json_clone FALSE) if(nlohmann_json_FOUND) message(STATUS "nlohmann::json dependency satisfied by: package") +elseif(TARGET nlohmann_json) + message(STATUS "nlohmann::json is already added as a CMake target!") elseif(EXISTS ${PROJECT_SOURCE_DIR}/.git AND EXISTS ${PROJECT_SOURCE_DIR}/third_party/nlohmann-json/CMakeLists.txt)