Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Clipper2 to be supplied externally when using Manifold as a submodule #1115

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions cmake/manifoldDeps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,27 @@ endif()

# If we're building cross_section, we need Clipper2
if(MANIFOLD_CROSS_SECTION)
if(NOT MANIFOLD_USE_BUILTIN_CLIPPER2)
if(NOT MANIFOLD_USE_BUILTIN_CLIPPER2 AND NOT Clipper2_FOUND)
find_package(Clipper2 QUIET)
if(NOT Clipper2_FOUND AND PKG_CONFIG_FOUND)
pkg_check_modules(Clipper2 Clipper2)
endif()
endif()
if(Clipper2_FOUND)
add_library(Clipper2 SHARED IMPORTED)
set_property(
TARGET Clipper2
PROPERTY IMPORTED_LOCATION ${Clipper2_LINK_LIBRARIES}
)
if(WIN32)
set_property(
TARGET Clipper2
PROPERTY IMPORTED_IMPLIB ${Clipper2_LINK_LIBRARIES}
)
endif()
target_include_directories(Clipper2 INTERFACE ${Clipper2_INCLUDE_DIRS})
else()
if(Clipper2_FOUND)
add_library(Clipper2 SHARED IMPORTED)
set_property(
TARGET Clipper2
PROPERTY IMPORTED_LOCATION ${Clipper2_LINK_LIBRARIES}
)
if(WIN32)
set_property(
TARGET Clipper2
PROPERTY IMPORTED_IMPLIB ${Clipper2_LINK_LIBRARIES}
)
endif()
target_include_directories(Clipper2 INTERFACE ${Clipper2_INCLUDE_DIRS})
endif(Clipper2_FOUND)
endif(NOT Clipper2_FOUND AND PKG_CONFIG_FOUND)
endif(NOT MANIFOLD_USE_BUILTIN_CLIPPER2 AND NOT Clipper2_FOUND)
if(NOT Clipper2_FOUND)
logmissingdep("Clipper2" , "cross_section")
set(MANIFOLD_USE_BUILTIN_CLIPPER2 ON)
set(CLIPPER2_UTILS OFF)
Expand Down
Loading