Skip to content

Commit

Permalink
Nested Superbuild Support
Browse files Browse the repository at this point in the history
Dependent projects might have the same dependencies and build
as a superbuild as well.
  • Loading branch information
ax3l committed Sep 5, 2024
1 parent c04fe38 commit 53155f6
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ endif()


# external library: nlohmann-json (required)
if(openPMD_USE_INTERNAL_JSON)
if(TARGET nlohmann_json::nlohmann_json)
# nothing to do, target already exists in the superbuild
elseif(openPMD_USE_INTERNAL_JSON)
set(JSON_BuildTests OFF CACHE INTERNAL "NLohmann JSON option defiend internally by openPMD")
set(JSON_Install OFF CACHE INTERNAL "NLohmann JSON option defiend internally by openPMD") # only used PRIVATE

Expand Down Expand Up @@ -285,7 +287,9 @@ target_link_libraries(openPMD::thirdparty::nlohmann_json
INTERFACE nlohmann_json::nlohmann_json)

# external library: toml11
if(openPMD_USE_INTERNAL_TOML11)
if(TARGET toml11::toml11)
# nothing to do, target already exists in the superbuild
elseif(openPMD_USE_INTERNAL_TOML11)
set(toml11_INSTALL OFF CACHE INTERNAL "toml11 option defined internally by openPMD")

# Git fetcher
Expand Down Expand Up @@ -440,7 +444,9 @@ else()
set(openPMD_HAVE_PYTHON FALSE)
endif()
if(Python_FOUND)
if(openPMD_USE_INTERNAL_PYBIND11)
if(TARGET pybind11::module)
# nothing to do, target already exists in the superbuild
elseif(openPMD_USE_INTERNAL_PYBIND11)
# Git fetcher
set(openPMD_pybind11_repo "https://github.com/pybind/pybind11.git"
CACHE STRING
Expand Down Expand Up @@ -589,7 +595,9 @@ target_include_directories(openPMD PUBLIC

# Catch2 for unit tests
if(openPMD_BUILD_TESTING)
if(openPMD_USE_INTERNAL_CATCH)
if(TARGET Catch2::Catch2)
# nothing to do, target already exists in the superbuild
elseif(openPMD_USE_INTERNAL_CATCH)
# Git fetcher
set(openPMD_catch_repo "https://github.com/catchorg/Catch2.git"
CACHE STRING
Expand Down

0 comments on commit 53155f6

Please sign in to comment.