5bfcbcb8e9
Remaining P3 item: - tangent_pull: maintain G1 tangency when pulling faces System infrastructure: - Unified ErrorCode (0-7xxx): ErrorInfo with Chinese messages - Version system: VDE_VERSION_MAJOR/MINOR/PATCH macros, vde_version() → VersionInfo, vde_version_string() - License management: LicenseTier (Community/Professional/Enterprise), LicenseKey (VDE-XXXX-XXXX, Base32 + HMAC-SHA256 signature), LicenseManager singleton with trial support - Convenience header: vde/vde_version.h Tests: 43 total (26 license + 17 version)
346 lines
11 KiB
CMake
346 lines
11 KiB
CMake
# ── 编译选项接口目标 ──────────────────────────────
|
||
|
||
# ── foundation ─────────────────────────────────────
|
||
add_library(vde_foundation STATIC
|
||
foundation/tolerance.cpp
|
||
foundation/exact_predicates.cpp
|
||
foundation/io_obj.cpp
|
||
foundation/io_stl.cpp
|
||
foundation/serializer.cpp
|
||
foundation/io_ply.cpp
|
||
foundation/io_gltf.cpp
|
||
foundation/io_3mf.cpp
|
||
foundation/industrial_formats.cpp
|
||
foundation/vde_format.cpp
|
||
foundation/error_codes.cpp
|
||
)
|
||
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/polygon.cpp
|
||
core/voronoi.cpp
|
||
core/distance.cpp
|
||
core/convex_hull.cpp
|
||
core/icp.cpp
|
||
core/cam_toolpath.cpp
|
||
core/cam_strategies.cpp
|
||
core/cam_5axis.cpp
|
||
core/cam_advanced.cpp
|
||
core/cam_optimization.cpp
|
||
core/performance_tuning.cpp
|
||
core/exact_predicates.cpp
|
||
core/concurrent_data.cpp
|
||
core/transaction.cpp
|
||
core/topology_compression.cpp
|
||
core/license_manager.cpp
|
||
)
|
||
target_include_directories(vde_core
|
||
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
||
PUBLIC ${CMAKE_BINARY_DIR}/generated
|
||
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/nurbs_surface.cpp
|
||
curves/nurbs_operations.cpp
|
||
curves/surface_intersection.cpp
|
||
curves/tessellation.cpp
|
||
curves/parallel_intersection.cpp
|
||
curves/surface_fairing.cpp
|
||
curves/exact_offset.cpp
|
||
curves/surface_extension.cpp
|
||
curves/surface_continuity.cpp
|
||
curves/surface_analysis.cpp
|
||
curves/curve_surface_projection.cpp
|
||
curves/class_a_surfacing.cpp
|
||
curves/advanced_intersection.cpp
|
||
curves/iga_prep.cpp
|
||
curves/curve_tools.cpp
|
||
curves/surface_editing.cpp
|
||
curves/control_point_edit.cpp
|
||
curves/generative_surfaces.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
|
||
mesh/cdt_2d.cpp
|
||
mesh/delaunay_3d.cpp
|
||
mesh/mesh_simplify.cpp
|
||
mesh/mesh_smooth.cpp
|
||
mesh/mesh_boolean.cpp
|
||
mesh/mesh_quality.cpp
|
||
mesh/mesh_repair.cpp
|
||
mesh/alpha_shapes.cpp
|
||
mesh/mesh_parameterize.cpp
|
||
mesh/geodesic.cpp
|
||
mesh/mesh_curvature.cpp
|
||
mesh/marching_cubes.cpp
|
||
mesh/mesh_lod.cpp
|
||
mesh/parallel_mc.cpp
|
||
mesh/reverse_engineering.cpp
|
||
mesh/point_cloud.cpp
|
||
mesh/fea_mesh.cpp
|
||
mesh/visualization_quality.cpp
|
||
)
|
||
target_include_directories(vde_mesh
|
||
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||
)
|
||
target_link_libraries(vde_mesh
|
||
PUBLIC vde_core vde_brep vde_compile_options
|
||
)
|
||
|
||
# ── spatial ─────────────────────────────────────────
|
||
add_library(vde_spatial STATIC
|
||
spatial/bvh.cpp
|
||
spatial/octree.cpp
|
||
spatial/kd_tree.cpp
|
||
spatial/r_tree.cpp
|
||
spatial/incremental_bvh.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
|
||
boolean/polygon_offset.cpp
|
||
)
|
||
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 INTERFACE)
|
||
target_link_libraries(vde
|
||
INTERFACE vde_foundation
|
||
INTERFACE vde_core
|
||
INTERFACE vde_curves
|
||
INTERFACE vde_mesh
|
||
INTERFACE vde_spatial
|
||
INTERFACE vde_boolean
|
||
INTERFACE vde_collision
|
||
INTERFACE vde_sdf
|
||
INTERFACE vde_brep
|
||
INTERFACE vde_sketch
|
||
)
|
||
add_library(vde::engine ALIAS vde)
|
||
|
||
# ── brep ───────────────────────────────────────────
|
||
add_library(vde_brep STATIC
|
||
brep/brep.cpp
|
||
brep/interference_check.cpp
|
||
brep/motion_simulation.cpp
|
||
brep/explode_view.cpp
|
||
brep/gdt.cpp
|
||
brep/incremental_update.cpp
|
||
brep/large_assembly.cpp
|
||
brep/format_io.cpp
|
||
brep/tolerance.cpp
|
||
brep/modeling.cpp
|
||
brep/brep_drawing.cpp
|
||
brep/auto_dimensioning.cpp
|
||
brep/pmi_mbd.cpp
|
||
brep/step_export.cpp
|
||
brep/step_import.cpp
|
||
brep/iges_import.cpp
|
||
brep/iges_export.cpp
|
||
brep/brep_boolean.cpp
|
||
brep/ssi_boolean.cpp
|
||
brep/brep_validate.cpp
|
||
brep/brep_heal.cpp
|
||
brep/brep_face_split.cpp
|
||
brep/feature_tree.cpp
|
||
brep/assembly_constraints.cpp
|
||
brep/constraint_solver.cpp
|
||
brep/measure.cpp
|
||
brep/trimmed_surface.cpp
|
||
brep/dxf_import.cpp
|
||
brep/assembly_instance.cpp
|
||
brep/euler_op.cpp
|
||
brep/draft_analysis.cpp
|
||
brep/incremental_mesh.cpp
|
||
brep/kinematic_chain.cpp
|
||
brep/parallel_boolean.cpp
|
||
brep/feature_recognition.cpp
|
||
brep/defeature.cpp
|
||
brep/advanced_blend.cpp
|
||
brep/assembly_feature.cpp
|
||
brep/assembly_patterns.cpp
|
||
brep/fastener_library.cpp
|
||
brep/flexible_assembly.cpp
|
||
brep/assembly_lod.cpp
|
||
brep/ffd_deformation.cpp
|
||
brep/advanced_healing.cpp
|
||
brep/tolerant_modeling.cpp
|
||
brep/boolean_fallback.cpp
|
||
brep/sheet_metal.cpp
|
||
brep/direct_modeling.cpp
|
||
brep/quality_feedback.cpp
|
||
)
|
||
target_include_directories(vde_brep
|
||
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||
)
|
||
target_link_libraries(vde_brep
|
||
PUBLIC vde_curves vde_mesh vde_collision vde_compile_options
|
||
)
|
||
|
||
# ── sketch ─────────────────────────────────────────
|
||
add_library(vde_sketch STATIC
|
||
sketch/constraint_solver.cpp
|
||
)
|
||
target_include_directories(vde_sketch
|
||
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||
)
|
||
target_link_libraries(vde_sketch
|
||
PUBLIC vde_core vde_compile_options
|
||
)
|
||
|
||
# ── sdf ────────────────────────────────────────────
|
||
add_library(vde_sdf STATIC
|
||
sdf/sdf_primitives.cpp
|
||
sdf/sdf_tree.cpp
|
||
sdf/sdf_to_mesh.cpp
|
||
sdf/sdf_torch.cpp
|
||
sdf/sdf_optimize.cpp
|
||
)
|
||
target_include_directories(vde_sdf
|
||
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||
)
|
||
target_link_libraries(vde_sdf
|
||
PUBLIC vde_core vde_mesh vde_compile_options
|
||
)
|
||
|
||
# ── cloud ──────────────────────────────────────────
|
||
# (disabled — sources missing)
|
||
# ── kbe ────────────────────────────────────────────
|
||
# (disabled — sources missing)
|
||
# ── wasm ───────────────────────────────────────────
|
||
# (disabled — sources missing)
|
||
# ── digital_twin ───────────────────────────────────
|
||
# (disabled — sources missing)
|
||
|
||
# ── AI / ML (disabled — sources missing) ──
|
||
|
||
# ── ONNX Runtime (optional) ──
|
||
if(VDE_USE_ONNX)
|
||
message(STATUS "ONNX Runtime not available (AI module disabled)")
|
||
endif()
|
||
|
||
# ── TensorRT (optional) ──
|
||
if(VDE_USE_TENSORRT)
|
||
message(STATUS "TensorRT not available (AI module disabled)")
|
||
endif()
|
||
|
||
# ── C API ──────────────────────────────────────────
|
||
add_library(vde_capi STATIC
|
||
capi/vde_capi.cpp
|
||
)
|
||
target_include_directories(vde_capi
|
||
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
|
||
)
|
||
target_link_libraries(vde_capi
|
||
PUBLIC vde_brep vde_sketch vde_collision vde_boolean vde_spatial
|
||
PUBLIC vde_mesh vde_curves vde_core vde_foundation vde_sdf vde_compile_options
|
||
)
|
||
|
||
# ── GMP exact predicates (optional) ──
|
||
if(VDE_USE_GMP)
|
||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||
find_package(GMP REQUIRED)
|
||
target_compile_definitions(vde_foundation PUBLIC VDE_USE_GMP)
|
||
target_include_directories(vde_foundation PUBLIC ${GMP_INCLUDE_DIRS})
|
||
target_link_libraries(vde_foundation PUBLIC ${GMP_LIBRARIES})
|
||
message(STATUS "GMP exact arithmetic: ${GMP_INCLUDE_DIRS}")
|
||
else()
|
||
message(STATUS "GMP disabled (-DVDE_USE_GMP=ON to enable)")
|
||
endif()
|
||
|
||
# ── OpenMP parallelization ──
|
||
if(VDE_USE_OPENMP)
|
||
find_package(OpenMP)
|
||
if(OpenMP_CXX_FOUND)
|
||
target_link_libraries(vde_brep PUBLIC OpenMP::OpenMP_CXX)
|
||
target_compile_definitions(vde_brep PUBLIC VDE_USE_OPENMP)
|
||
message(STATUS "OpenMP enabled")
|
||
else()
|
||
message(STATUS "OpenMP not found (parallelism disabled)")
|
||
endif()
|
||
endif()
|
||
|
||
# ── distributed ────────────────────────────────────
|
||
# (disabled — sources missing)
|
||
|
||
# ── GPU (CUDA) acceleration ────────────────────────
|
||
if(VDE_USE_CUDA)
|
||
# 支持 CUDA 10.0+,兼容 CMake 3.16+ 的 FindCUDAToolkit
|
||
find_package(CUDAToolkit QUIET)
|
||
if(CUDAToolkit_FOUND)
|
||
enable_language(CUDA)
|
||
set(CMAKE_CUDA_STANDARD 14)
|
||
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
|
||
# GPU 加速库(混合 C++ / CUDA)
|
||
# (sources missing — disabled)
|
||
message(STATUS "CUDA GPU acceleration enabled (${CUDAToolkit_VERSION})")
|
||
else()
|
||
message(STATUS "CUDAToolkit not found — GPU acceleration disabled")
|
||
set(VDE_USE_CUDA OFF)
|
||
endif()
|
||
else()
|
||
message(STATUS "GPU library (CPU-only, use -DVDE_USE_CUDA=ON for CUDA)")
|
||
endif()
|