From d91e805cd5552caa72bff66ef573a0490fbcefb4 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Sat, 12 Oct 2024 11:09:31 +0200 Subject: [PATCH] [CMake] Don't require `json` in ROOTConfig if no components specified If components are not specified, we should assume nlohmann_json is not required. Propagating the dependency on nlohmann_json just for the sake of one ROOT feature (ROOTEve) that might be used is unreasonable. We can expect from the users that link against ROOTEve to list this component explicitly. --- cmake/scripts/ROOTConfig.cmake.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/scripts/ROOTConfig.cmake.in b/cmake/scripts/ROOTConfig.cmake.in index b61d0c2cd41f8..cf6b139a5d467 100644 --- a/cmake/scripts/ROOTConfig.cmake.in +++ b/cmake/scripts/ROOTConfig.cmake.in @@ -112,10 +112,11 @@ if (NOT ROOT_builtin_nlohmannjson_FOUND) set(_need_json TRUE) endif() endforeach() - else() - # if components not specified - suppose all - set(_need_json TRUE) endif() + # If components are not specified, we assume json is not required. + # Propagating the dependency on nlohmann_json just for the sake of one small + # ROOT feature that might be used is unreasonable. We can expect from the + # users that link against ROOTEve to list this component explicitly. endif() if(_need_json)