Skip to content

Commit ab8512e

Browse files
committed
Add Clipper2 as a dependency (needed by Manifold)
1 parent dccdb61 commit ab8512e

File tree

5 files changed

+69
-0
lines changed

5 files changed

+69
-0
lines changed

.gitmodules

+5
Original file line numberDiff line numberDiff line change
@@ -317,3 +317,8 @@
317317
url = https://github.com/BRL-CAD/glm.git
318318
branch = RELEASE
319319
ignore = dirty
320+
[submodule "clipper2/Clipper2"]
321+
path = clipper2/Clipper2
322+
url = https://github.com/BRL-CAD/Clipper2.git
323+
branch = RELEASE
324+
ignore = dirty

clipper2/CMakeLists.txt

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Decide if we're using clipper2
2+
cad_enable(CLIPPER2 "librt")
3+
4+
bext_enable(CLIPPER2)
5+
6+
# Decision made
7+
8+
if (ENABLE_CLIPPER2)
9+
10+
git_submodule_init(Clipper2 readme.md)
11+
12+
RegisterDeps(CLIPPER2)
13+
14+
ExternalProject_Add(CLIPPER2_BLD
15+
URL "${CMAKE_CURRENT_SOURCE_DIR}/Clipper2/CPP"
16+
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
17+
#PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/clipper2.patch
18+
CMAKE_ARGS
19+
${BUILD_TYPE_SPECIFIER}
20+
-DCLIPPER2_UTILS=OFF
21+
-DCLIPPER2_EXAMPLES=OFF
22+
-DCLIPPER2_TESTS=OFF
23+
-DCLIPPER2_USINGZ=OFF
24+
-DBIN_DIR=${BIN_DIR}
25+
-DLIB_DIR=${LIB_DIR}
26+
-DBUILD_SHARED_LIBS=ON
27+
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
28+
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
29+
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
30+
-DCMAKE_INSTALL_PREFIX=${CMAKE_BUNDLE_INSTALL_PREFIX}
31+
-DCMAKE_INSTALL_LIBDIR:PATH=${LIB_DIR}
32+
-DCMAKE_INSTALL_RPATH=${CMAKE_BUNDLE_INSTALL_PREFIX}/${LIB_DIR}
33+
LOG_CONFIGURE ${EXT_BUILD_QUIET}
34+
LOG_BUILD ${EXT_BUILD_QUIET}
35+
LOG_INSTALL ${EXT_BUILD_QUIET}
36+
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET}
37+
STEP_TARGETS install
38+
)
39+
40+
TargetInstallDeps(CLIPPER2 CLIPPER2_DEPENDS)
41+
42+
# Copy the license into position in CMAKE_BUNDLE_INSTALL_PREFIX
43+
configure_file(
44+
${CMAKE_CURRENT_SOURCE_DIR}/Clipper2/LICENSE
45+
${DOC_LICENSE_DIR}/clipper2.txt
46+
COPYONLY
47+
)
48+
49+
endif (ENABLE_CLIPPER2)
50+
51+
# Local Variables:
52+
# tab-width: 8
53+
# mode: cmake
54+
# indent-tabs-mode: t
55+
# End:
56+
# ex: shiftwidth=2 tabstop=8
57+

clipper2/Clipper2

Submodule Clipper2 added at 736ddb0

clipper2/clipper2.deps

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
PATCH
2+

dependencies.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ add_project(assetimport GROUPS "BRLCAD")
232232
# http://opencv.org
233233
add_project(opencv GROUPS "BRLCAD_EXTRA")
234234

235+
# Clipper2 - A Polygon Clipping and Offsetting library
236+
# https://github.com/AngusJohnson/Clipper2
237+
add_project(clipper2 GROUPS "BRLCAD")
238+
235239
# GeometricTools - a collection of geometry algorithms.
236240
# https://github.com/davideberly/GeometricTools
237241
add_project(gte GROUPS "BRLCAD")

0 commit comments

Comments
 (0)