Skip to content

Commit 29b9d08

Browse files
fuhlig1dennisklein
authored andcommitted
Check for system installation of lohmann-json
Switch off the root builtin version if a system installation exist. On macosx there is a compilation error otherwise. (cherry picked from commit f14b375) (see #555)
1 parent 604b8b2 commit 29b9d08

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmake/legacy.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,19 @@ else()
374374
unset(root_cocoa)
375375
set(root_x11 ON)
376376
endif()
377+
find_package(nlohmann_json 3.9)
378+
if(nlohmann_json_FOUND)
379+
set(root_builtin_nlohmannjson "-Dbuiltin_nlohmannjson=OFF")
380+
else()
381+
set(root_builtin_nlohmannjson "-Dbuiltin_nlohmannjson=ON")
382+
endif()
383+
377384
ExternalProject_Add(root
378385
GIT_REPOSITORY https://github.com/root-project/root/ GIT_TAG v${root_version_gittag}
379386
GIT_SHALLOW 1
380387
${CMAKE_DEFAULT_ARGS} CMAKE_ARGS
381388
"-Daqua=ON"
382389
"-Dasimage=ON"
383-
"-Dbuiltin_nlohmannjson=ON"
384390
"-Dcintex=OFF"
385391
"-Ddavix=OFF"
386392
"-Dfftw3=ON"
@@ -410,6 +416,7 @@ ExternalProject_Add(root
410416
${cmake_python_config}
411417
${cmake_python_config_old}
412418
${root_builtin_glew}
419+
${root_builtin_nlohmannjson}
413420
${root_cocoa}
414421
UPDATE_DISCONNECTED ON
415422
PATCH_COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_macos_sdk_mismatch.patch"

0 commit comments

Comments
 (0)