11cmake_minimum_required (VERSION 3.12 )
2- project (SofaShells VERSION 1.0 LANGUAGES CXX )
3-
2+ project (Shell VERSION 1.0 LANGUAGES CXX )
43
4+ # Find and load CMake configuration of packages containing this plugin's dependencies
55find_package (Sofa.Config REQUIRED )
66sofa_find_package (Sofa.GL REQUIRED )
77sofa_find_package (Sofa.Type REQUIRED )
@@ -17,135 +17,126 @@ sofa_find_package(Sofa.Component.Constraint.Lagrangian.Solver REQUIRED)
1717sofa_find_package (Sofa.Component.Topology.Container.Dynamic REQUIRED )
1818sofa_find_package (Sofa.Component.Collision.Detection.Intersection REQUIRED )
1919
20-
21-
22- set (README_FILE "SofaShells.txt" )
20+ set (README_FILE README.md)
2321set (SOFASHELLS_SRC_DIR src/SofaShells)
2422
25-
2623option (SOFA-PLUGIN_SHELLS_ADAPTIVITY "Enables shells adaptivity" OFF )
2724
28-
25+ # List all files
26+ set (SHELL_SRC_DIR src/Shell)
2927set (HEADER_FILES
30-
31- ${SOFASHELLS_SRC_DIR} /config.h.in
32- ${SOFASHELLS_SRC_DIR} /controller/MeshChangedEvent.h
33- ${SOFASHELLS_SRC_DIR} /controller/MeshInterpolator.h
34- ${SOFASHELLS_SRC_DIR} /controller/MeshInterpolator.inl
35- ${SOFASHELLS_SRC_DIR} /controller/TriangleSwitchExample.h
36- ${SOFASHELLS_SRC_DIR} /controller/TriangleSwitchExample.inl
37- ${SOFASHELLS_SRC_DIR} /engine/JoinMeshPoints.h
38- ${SOFASHELLS_SRC_DIR} /engine/JoinMeshPoints.inl
39- ${SOFASHELLS_SRC_DIR} /engine/FindClosePoints.h
40- ${SOFASHELLS_SRC_DIR} /engine/FindClosePoints.inl
41- ${SOFASHELLS_SRC_DIR} /forcefield/BezierTriangularBendingFEMForceField.h
42- ${SOFASHELLS_SRC_DIR} /forcefield/BezierTriangularBendingFEMForceField.inl
43- ${SOFASHELLS_SRC_DIR} /forcefield/CstFEMForceField.h
44- ${SOFASHELLS_SRC_DIR} /forcefield/CstFEMForceField.inl
45- ${SOFASHELLS_SRC_DIR} /forcefield/TriangularBendingFEMForceField.h
46- ${SOFASHELLS_SRC_DIR} /forcefield/TriangularBendingFEMForceField.inl
47- ${SOFASHELLS_SRC_DIR} /forcefield/TriangularShellForceField.h
48- ${SOFASHELLS_SRC_DIR} /forcefield/TriangularShellForceField.inl
49- ${SOFASHELLS_SRC_DIR} /mapping/BendingPlateMechanicalMapping.h
50- ${SOFASHELLS_SRC_DIR} /mapping/BendingPlateMechanicalMapping.inl
51- ${SOFASHELLS_SRC_DIR} /mapping/BezierTriangleMechanicalMapping.h
52- ${SOFASHELLS_SRC_DIR} /mapping/BezierTriangleMechanicalMapping.inl
53- ${SOFASHELLS_SRC_DIR} /misc/PointProjection.h
54- ${SOFASHELLS_SRC_DIR} /misc/PointProjection.inl
55- ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolation.h
56- ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolation.inl
57- ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolationM.h
58- ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolationM.inl
59- ${SOFASHELLS_SRC_DIR} /shells2/forcefield/BezierShellForceField.h
60- ${SOFASHELLS_SRC_DIR} /shells2/forcefield/BezierShellForceField.inl
61- ${SOFASHELLS_SRC_DIR} /shells2/mapping/BezierShellMechanicalMapping.h
62- ${SOFASHELLS_SRC_DIR} /shells2/mapping/BezierShellMechanicalMapping.inl
63- )
28+ ${SOFASHELLS_SRC_DIR} /config.h.in
29+ ${SOFASHELLS_SRC_DIR} /controller/MeshChangedEvent.h
30+ ${SOFASHELLS_SRC_DIR} /controller/MeshInterpolator.h
31+ ${SOFASHELLS_SRC_DIR} /controller/MeshInterpolator.inl
32+ ${SOFASHELLS_SRC_DIR} /controller/TriangleSwitchExample.h
33+ ${SOFASHELLS_SRC_DIR} /controller/TriangleSwitchExample.inl
34+ ${SOFASHELLS_SRC_DIR} /engine/JoinMeshPoints.h
35+ ${SOFASHELLS_SRC_DIR} /engine/JoinMeshPoints.inl
36+ ${SOFASHELLS_SRC_DIR} /engine/FindClosePoints.h
37+ ${SOFASHELLS_SRC_DIR} /engine/FindClosePoints.inl
38+ ${SOFASHELLS_SRC_DIR} /forcefield/BezierTriangularBendingFEMForceField.h
39+ ${SOFASHELLS_SRC_DIR} /forcefield/BezierTriangularBendingFEMForceField.inl
40+ ${SOFASHELLS_SRC_DIR} /forcefield/CstFEMForceField.h
41+ ${SOFASHELLS_SRC_DIR} /forcefield/CstFEMForceField.inl
42+ ${SOFASHELLS_SRC_DIR} /forcefield/TriangularBendingFEMForceField.h
43+ ${SOFASHELLS_SRC_DIR} /forcefield/TriangularBendingFEMForceField.inl
44+ ${SOFASHELLS_SRC_DIR} /forcefield/TriangularShellForceField.h
45+ ${SOFASHELLS_SRC_DIR} /forcefield/TriangularShellForceField.inl
46+ ${SOFASHELLS_SRC_DIR} /mapping/BendingPlateMechanicalMapping.h
47+ ${SOFASHELLS_SRC_DIR} /mapping/BendingPlateMechanicalMapping.inl
48+ ${SOFASHELLS_SRC_DIR} /mapping/BezierTriangleMechanicalMapping.h
49+ ${SOFASHELLS_SRC_DIR} /mapping/BezierTriangleMechanicalMapping.inl
50+ ${SOFASHELLS_SRC_DIR} /misc/PointProjection.h
51+ ${SOFASHELLS_SRC_DIR} /misc/PointProjection.inl
52+ ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolation.h
53+ ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolation.inl
54+ ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolationM.h
55+ ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolationM.inl
56+ ${SOFASHELLS_SRC_DIR} /shells2/forcefield/BezierShellForceField.h
57+ ${SOFASHELLS_SRC_DIR} /shells2/forcefield/BezierShellForceField.inl
58+ ${SOFASHELLS_SRC_DIR} /shells2/mapping/BezierShellMechanicalMapping.h
59+ ${SOFASHELLS_SRC_DIR} /shells2/mapping/BezierShellMechanicalMapping.inl
60+ )
6461
6562set (SOURCE_FILES
66-
67- ${SOFASHELLS_SRC_DIR} /initPluginShells.cpp
68- ${SOFASHELLS_SRC_DIR} /controller/MeshChangedEvent.cpp
69- ${SOFASHELLS_SRC_DIR} /controller/MeshInterpolator.cpp
70- ${SOFASHELLS_SRC_DIR} /controller/TriangleSwitchExample.cpp
71- ${SOFASHELLS_SRC_DIR} /engine/JoinMeshPoints.cpp
72- ${SOFASHELLS_SRC_DIR} /engine/FindClosePoints.cpp
73- ${SOFASHELLS_SRC_DIR} /forcefield/BezierTriangularBendingFEMForceField.cpp
74- ${SOFASHELLS_SRC_DIR} /forcefield/CstFEMForceField.cpp
75- ${SOFASHELLS_SRC_DIR} /forcefield/TriangularBendingFEMForceField.cpp
76- ${SOFASHELLS_SRC_DIR} /forcefield/TriangularShellForceField.cpp
77- ${SOFASHELLS_SRC_DIR} /mapping/BendingPlateMechanicalMapping.cpp
78- ${SOFASHELLS_SRC_DIR} /mapping/BezierTriangleMechanicalMapping.cpp
79- ${SOFASHELLS_SRC_DIR} /misc/PointProjection.cpp
80- ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolation.cpp
81- ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolationM.cpp
82- ${SOFASHELLS_SRC_DIR} /shells2/forcefield/BezierShellForceField.cpp
83- ${SOFASHELLS_SRC_DIR} /shells2/mapping/BezierShellMechanicalMapping.cpp
84- )
85-
86-
87-
88-
89-
63+ ${SOFASHELLS_SRC_DIR} /initPluginShells.cpp
64+ ${SOFASHELLS_SRC_DIR} /controller/MeshChangedEvent.cpp
65+ ${SOFASHELLS_SRC_DIR} /controller/MeshInterpolator.cpp
66+ ${SOFASHELLS_SRC_DIR} /controller/TriangleSwitchExample.cpp
67+ ${SOFASHELLS_SRC_DIR} /engine/JoinMeshPoints.cpp
68+ ${SOFASHELLS_SRC_DIR} /engine/FindClosePoints.cpp
69+ ${SOFASHELLS_SRC_DIR} /forcefield/BezierTriangularBendingFEMForceField.cpp
70+ ${SOFASHELLS_SRC_DIR} /forcefield/CstFEMForceField.cpp
71+ ${SOFASHELLS_SRC_DIR} /forcefield/TriangularBendingFEMForceField.cpp
72+ ${SOFASHELLS_SRC_DIR} /forcefield/TriangularShellForceField.cpp
73+ ${SOFASHELLS_SRC_DIR} /mapping/BendingPlateMechanicalMapping.cpp
74+ ${SOFASHELLS_SRC_DIR} /mapping/BezierTriangleMechanicalMapping.cpp
75+ ${SOFASHELLS_SRC_DIR} /misc/PointProjection.cpp
76+ ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolation.cpp
77+ ${SOFASHELLS_SRC_DIR} /shells2/fem/BezierShellInterpolationM.cpp
78+ ${SOFASHELLS_SRC_DIR} /shells2/forcefield/BezierShellForceField.cpp
79+ ${SOFASHELLS_SRC_DIR} /shells2/mapping/BezierShellMechanicalMapping.cpp
80+ )
9081
9182if (SOFA-PLUGIN_SHELLS_ADAPTIVITY)
92- set (COMPILER_DEFINE "SOFA_BUILD_SHELLS_ADAPTIVITY" )
93-
94- list (APPEND HEADER_FILES
95-
96- ${SOFASHELLS_SRC_DIR} /controller/AdaptiveCuttingController.h
97- ${SOFASHELLS_SRC_DIR} /controller/AdaptiveCuttingController.inl
98- ${SOFASHELLS_SRC_DIR} /controller/Test2DAdapter.h
99- ${SOFASHELLS_SRC_DIR} /controller/Test2DAdapter.inl
100- ${SOFASHELLS_SRC_DIR} /misc/Optimize2DSurface.h
101- ${SOFASHELLS_SRC_DIR} /misc/Optimize2DSurface.inl
102- ${SOFASHELLS_SRC_DIR} /misc/SurfaceParametrization.h
103- ${SOFASHELLS_SRC_DIR} /misc/SurfaceParametrization.inl
104- )
105-
106-
107- list (APPEND SOURCE_FILES
108-
109- ${SOFASHELLS_SRC_DIR} /controller/AdaptiveCuttingController.cpp
110- ${SOFASHELLS_SRC_DIR} /controller/Test2DAdapter.cpp
111- ${SOFASHELLS_SRC_DIR} /misc/Optimize2DSurface.cpp
112- ${SOFASHELLS_SRC_DIR} /misc/SurfaceParametrization.cpp
113- )
114-
115-
116- if (SofaGui_FOUND AND SofaOpenglVisual_FOUND)
83+ set (COMPILER_DEFINE "SOFA_BUILD_SHELLS_ADAPTIVITY" )
84+
85+ list (APPEND HEADER_FILES
86+ ${SOFASHELLS_SRC_DIR} /controller/AdaptiveCuttingController.h
87+ ${SOFASHELLS_SRC_DIR} /controller/AdaptiveCuttingController.inl
88+ ${SOFASHELLS_SRC_DIR} /controller/Test2DAdapter.h
89+ ${SOFASHELLS_SRC_DIR} /controller/Test2DAdapter.inl
90+ ${SOFASHELLS_SRC_DIR} /misc/Optimize2DSurface.h
91+ ${SOFASHELLS_SRC_DIR} /misc/Optimize2DSurface.inl
92+ ${SOFASHELLS_SRC_DIR} /misc/SurfaceParametrization.h
93+ ${SOFASHELLS_SRC_DIR} /misc/SurfaceParametrization.inl
94+ )
11795
118- list (APPEND HEADER_FILES
119- ${SOFASHELLS_SRC_DIR} /cutting/AdaptiveCutting.h
120- )
96+ list (APPEND SOURCE_FILES
97+ ${SOFASHELLS_SRC_DIR} /controller/AdaptiveCuttingController.cpp
98+ ${SOFASHELLS_SRC_DIR} /controller/Test2DAdapter.cpp
99+ ${SOFASHELLS_SRC_DIR} /misc/Optimize2DSurface.cpp
100+ ${SOFASHELLS_SRC_DIR} /misc/SurfaceParametrization.cpp
101+ )
121102
122- list (APPEND SOURCE_FILES
123- ${SOFASHELLS_SRC_DIR} /cutting/AdaptiveCutting.cpp
124- )
103+ if (SofaGui_FOUND AND SofaOpenglVisual_FOUND)
104+ list (APPEND HEADER_FILES
105+ ${SOFASHELLS_SRC_DIR} /cutting/AdaptiveCutting.h
106+ )
125107
126- endif ()
108+ list (APPEND SOURCE_FILES
109+ ${SOFASHELLS_SRC_DIR} /cutting/AdaptiveCutting.cpp
110+ )
111+ endif ()
127112
128113endif ()
129114
130115
131116# Create the plugin library
132117add_library (${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES} )
133118
134- # Link the plugin library to its dependency
135- target_link_libraries (${PROJECT_NAME} Sofa.Component.Controller Sofa.Helper Sofa.Type Sofa.Component.Topology.Container.Dynamic Sofa.Component.StateContainer
136- Sofa.Core Sofa.Geometry Sofa.GL Sofa.Component.Collision.Detection.Intersection Sofa.Component.Mapping.NonLinear Sofa.Component.Constraint.Lagrangian.Model
137- Sofa.Component.Constraint.Lagrangian.Solver Sofa.Component.Constraint.Lagrangian Sofa.Component.Constraint
138- Sofa.Simulation.Core Sofa.Component.Constraint.Projective Sofa.Component.Mass Sofa.Component.SolidMechanics.Spring Sofa.Component.MechanicalLoad
139- Sofa.Component.LinearSolver.Iterative Sofa.Component.ODESolver.Backward Sofa.Component.Engine.Select Sofa.Component.Mapping.Linear
119+ # Link the plugin library to its dependency(ies).
120+ target_link_libraries (${PROJECT_NAME}
121+ Sofa.Component.Controller
122+ Sofa.Component.Topology.Container.Dynamic
123+ Sofa.Component.StateContainer
124+ Sofa.GL
125+ Sofa.Component.Collision.Detection.Intersection
126+ Sofa.Component.Mapping.NonLinear
127+ Sofa.Component.Constraint.Lagrangian.Model
128+ Sofa.Component.Constraint.Lagrangian.Solver
129+ Sofa.Component.Constraint.Lagrangian
130+ Sofa.Component.Constraint.Projective
131+ Sofa.Component.Mass
132+ Sofa.Component.SolidMechanics.Spring
133+ Sofa.Component.MechanicalLoad
134+ Sofa.Component.LinearSolver.Iterative
135+ Sofa.Component.ODESolver.Backward
136+ Sofa.Component.Engine.Select
137+ Sofa.Component.Mapping.Linear
140138)
141139
142-
143- if (SofaGui_FOUND AND SofaOpenglVisual_FOUND)
144- target_link_libraries (${PROJECT_NAME} SofaGui SofaOpenglVisual )
145- endif ()
146-
147-
148- # Create package Config, Version & Target files
149140sofa_create_package_with_targets (
150141 PACKAGE_NAME ${PROJECT_NAME}
151142 PACKAGE_VERSION ${PROJECT_VERSION}
0 commit comments