Skip to content

Commit

Permalink
Merge pull request cburstedde#301 from jmark/cmake-conditional-libsc-…
Browse files Browse the repository at this point in the history
…registration

Check if libsc is already a known target.
  • Loading branch information
cburstedde authored Apr 18, 2024
2 parents 256c4c2 + 4c25154 commit 7b66b0a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ message(STATUS "p4est ${PROJECT_VERSION} "

# --- external libs

include(cmake/GitSubmodule.cmake)
git_submodule("${PROJECT_SOURCE_DIR}/sc")
add_subdirectory(sc)
# Skip `libsc` if already registered. This is useful when `p4est` is added as a
# dependency by another software project which in turn already registered `libsc`.
if(NOT TARGET SC::SC)
include(cmake/GitSubmodule.cmake)
git_submodule("${PROJECT_SOURCE_DIR}/sc")
add_subdirectory(sc)
endif()

# --- configure p4est

Expand Down

0 comments on commit 7b66b0a

Please sign in to comment.