@@ -255,7 +255,10 @@ endif()
255
255
256
256
257
257
# external library: nlohmann-json (required)
258
- if (openPMD_USE_INTERNAL_JSON)
258
+ if (TARGET nlohmann_json::nlohmann_json)
259
+ # nothing to do, target already exists in the superbuild
260
+ message (STATUS "nlohmann_json::nlohmann_json target already imported" )
261
+ elseif (openPMD_USE_INTERNAL_JSON)
259
262
set (JSON_BuildTests OFF CACHE INTERNAL "NLohmann JSON option defiend internally by openPMD" )
260
263
set (JSON_Install OFF CACHE INTERNAL "NLohmann JSON option defiend internally by openPMD" ) # only used PRIVATE
261
264
@@ -285,7 +288,10 @@ target_link_libraries(openPMD::thirdparty::nlohmann_json
285
288
INTERFACE nlohmann_json::nlohmann_json)
286
289
287
290
# external library: toml11
288
- if (openPMD_USE_INTERNAL_TOML11)
291
+ if (TARGET toml11::toml11)
292
+ # nothing to do, target already exists in the superbuild
293
+ message (STATUS "toml11::toml11 target already imported" )
294
+ elseif (openPMD_USE_INTERNAL_TOML11)
289
295
set (toml11_INSTALL OFF CACHE INTERNAL "toml11 option defined internally by openPMD" )
290
296
291
297
# Git fetcher
@@ -440,7 +446,10 @@ else()
440
446
set (openPMD_HAVE_PYTHON FALSE )
441
447
endif ()
442
448
if (Python_FOUND)
443
- if (openPMD_USE_INTERNAL_PYBIND11)
449
+ if (TARGET pybind11::module)
450
+ # nothing to do, target already exists in the superbuild
451
+ message (STATUS "pybind11::module target already imported" )
452
+ elseif (openPMD_USE_INTERNAL_PYBIND11)
444
453
# Git fetcher
445
454
set (openPMD_pybind11_repo "https://github.com/pybind/pybind11.git"
446
455
CACHE STRING
@@ -589,7 +598,10 @@ target_include_directories(openPMD PUBLIC
589
598
590
599
# Catch2 for unit tests
591
600
if (openPMD_BUILD_TESTING)
592
- if (openPMD_USE_INTERNAL_CATCH)
601
+ if (TARGET Catch2::Catch2)
602
+ # nothing to do, target already exists in the superbuild
603
+ message (STATUS "Catch2::Catch2 target already imported" )
604
+ elseif (openPMD_USE_INTERNAL_CATCH)
593
605
# Git fetcher
594
606
set (openPMD_catch_repo "https://github.com/catchorg/Catch2.git"
595
607
CACHE STRING
0 commit comments