2026-07-23 05:27:51 +00:00
|
|
|
# ── 编译选项接口目标 ──────────────────────────────
|
|
|
|
|
add_library(vde_compile_options INTERFACE)
|
|
|
|
|
include(${CMAKE_SOURCE_DIR}/cmake/CompilerSettings.cmake)
|
|
|
|
|
|
|
|
|
|
# ── foundation ─────────────────────────────────────
|
|
|
|
|
add_library(vde_foundation STATIC
|
|
|
|
|
foundation/tolerance.cpp
|
|
|
|
|
foundation/exact_predicates.cpp
|
|
|
|
|
foundation/io_obj.cpp
|
|
|
|
|
foundation/io_stl.cpp
|
2026-07-23 06:27:43 +00:00
|
|
|
foundation/serializer.cpp
|
2026-07-23 05:27:51 +00:00
|
|
|
)
|
|
|
|
|
target_include_directories(vde_foundation
|
|
|
|
|
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(vde_foundation
|
|
|
|
|
PUBLIC vde_compile_options Eigen3::Eigen
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# ── core ───────────────────────────────────────────
|
|
|
|
|
add_library(vde_core STATIC
|
|
|
|
|
core/point.cpp
|
|
|
|
|
core/transform.cpp
|
|
|
|
|
core/polygon.cpp
|
2026-07-23 06:27:43 +00:00
|
|
|
core/voronoi.cpp
|
2026-07-23 05:27:51 +00:00
|
|
|
core/distance.cpp
|
|
|
|
|
core/convex_hull.cpp
|
|
|
|
|
)
|
|
|
|
|
target_include_directories(vde_core
|
|
|
|
|
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(vde_core
|
|
|
|
|
PUBLIC vde_foundation vde_compile_options
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# ── curves ─────────────────────────────────────────
|
|
|
|
|
add_library(vde_curves STATIC
|
|
|
|
|
curves/bezier_curve.cpp
|
|
|
|
|
curves/bspline_curve.cpp
|
|
|
|
|
curves/nurbs_curve.cpp
|
|
|
|
|
curves/bezier_surface.cpp
|
|
|
|
|
curves/bspline_surface.cpp
|
|
|
|
|
curves/tessellation.cpp
|
|
|
|
|
)
|
|
|
|
|
target_include_directories(vde_curves
|
|
|
|
|
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(vde_curves
|
|
|
|
|
PUBLIC vde_core vde_compile_options
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# ── mesh ────────────────────────────────────────────
|
|
|
|
|
add_library(vde_mesh STATIC
|
|
|
|
|
mesh/halfedge_mesh.cpp
|
|
|
|
|
mesh/delaunay_2d.cpp
|
2026-07-23 07:04:11 +00:00
|
|
|
mesh/cdt_2d.cpp
|
2026-07-23 06:28:34 +00:00
|
|
|
mesh/delaunay_3d.cpp
|
2026-07-23 05:27:51 +00:00
|
|
|
mesh/mesh_simplify.cpp
|
|
|
|
|
mesh/mesh_smooth.cpp
|
|
|
|
|
mesh/mesh_boolean.cpp
|
|
|
|
|
mesh/mesh_quality.cpp
|
|
|
|
|
mesh/mesh_repair.cpp
|
2026-07-23 07:04:11 +00:00
|
|
|
mesh/geodesic.cpp
|
2026-07-23 06:27:43 +00:00
|
|
|
mesh/mesh_curvature.cpp
|
|
|
|
|
mesh/marching_cubes.cpp
|
2026-07-23 05:27:51 +00:00
|
|
|
)
|
|
|
|
|
target_include_directories(vde_mesh
|
|
|
|
|
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(vde_mesh
|
|
|
|
|
PUBLIC vde_core vde_compile_options
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# ── spatial ─────────────────────────────────────────
|
|
|
|
|
add_library(vde_spatial STATIC
|
|
|
|
|
spatial/bvh.cpp
|
|
|
|
|
spatial/octree.cpp
|
|
|
|
|
spatial/kd_tree.cpp
|
|
|
|
|
spatial/r_tree.cpp
|
|
|
|
|
)
|
|
|
|
|
target_include_directories(vde_spatial
|
|
|
|
|
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(vde_spatial
|
|
|
|
|
PUBLIC vde_core vde_compile_options
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# ── boolean ─────────────────────────────────────────
|
|
|
|
|
add_library(vde_boolean STATIC
|
|
|
|
|
boolean/boolean_2d.cpp
|
|
|
|
|
boolean/boolean_mesh.cpp
|
2026-07-23 06:28:34 +00:00
|
|
|
boolean/polygon_offset.cpp
|
2026-07-23 05:27:51 +00:00
|
|
|
)
|
|
|
|
|
target_include_directories(vde_boolean
|
|
|
|
|
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(vde_boolean
|
|
|
|
|
PUBLIC vde_mesh vde_spatial vde_compile_options
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# ── collision ───────────────────────────────────────
|
|
|
|
|
add_library(vde_collision STATIC
|
|
|
|
|
collision/gjk.cpp
|
|
|
|
|
collision/sat.cpp
|
|
|
|
|
collision/ray_intersect.cpp
|
|
|
|
|
collision/tri_intersect.cpp
|
|
|
|
|
)
|
|
|
|
|
target_include_directories(vde_collision
|
|
|
|
|
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(vde_collision
|
|
|
|
|
PUBLIC vde_core vde_spatial vde_compile_options
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# ── 聚合库 ──────────────────────────────────────────
|
|
|
|
|
add_library(vde ${CMAKE_BUILD_TYPE_LIB})
|
|
|
|
|
target_link_libraries(vde
|
|
|
|
|
PUBLIC vde_foundation
|
|
|
|
|
PUBLIC vde_core
|
|
|
|
|
PUBLIC vde_curves
|
|
|
|
|
PUBLIC vde_mesh
|
|
|
|
|
PUBLIC vde_spatial
|
|
|
|
|
PUBLIC vde_boolean
|
|
|
|
|
PUBLIC vde_collision
|
|
|
|
|
)
|
|
|
|
|
add_library(vde::engine ALIAS vde)
|