-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
184 lines (146 loc) · 7.63 KB
/
CMakeLists.txt
File metadata and controls
184 lines (146 loc) · 7.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
##############################################################################
# - Copyright (C) 2020-Present InfinyTech3D - #
# #
# This file is part of the InfinyToolkit plugin for the SOFA framework. #
# #
# This file is dual-licensed: #
# #
# 1) Commercial License: #
# This file may be used under the terms of a valid commercial license #
# agreement provided wih the software by InfinyTech3D. #
# #
# 2) GNU General Public License (GPLv3) Usage #
# Alternatively, this file may be used under the terms of the #
# GNU General Public License version 3 as published by the #
# Free Software Foundation: https://www.gnu.org/licenses/gpl-3.0.html #
# #
# Contact: contact@infinytech3d.com #
# Further information: https://infinytech3d.com #
##############################################################################
cmake_minimum_required(VERSION 3.12)
project(InfinyToolkit VERSION 0.1 LANGUAGES CXX)
include(cmake/environment.cmake)
find_package(Sofa.Component.StateContainer REQUIRED)
find_package(Sofa.Component.MechanicalLoad REQUIRED)
find_package(Sofa.Component.Topology.Container.Dynamic REQUIRED)
find_package(Sofa.Component.SolidMechanics.Spring REQUIRED)
find_package(Sofa.Component.Constraint.Projective REQUIRED)
find_package(Sofa.Component.Collision.Geometry REQUIRED)
find_package(Sofa.Component.Controller REQUIRED)
find_package(Sofa.Component.Haptics REQUIRED)
find_package(Sofa.GUI.Component REQUIRED)
find_package(Sofa.Component.Engine.Select REQUIRED)
set(USE_INFINYTOOLKIT_PLUGIN true CACHE BOOL "Use Interaction Tools plugin")
set(INFINYTOOLKIT_SRC_DIR src/InfinyToolkit)
set(HEADER_FILES
${INFINYTOOLKIT_SRC_DIR}/config.h.in
${INFINYTOOLKIT_SRC_DIR}/initInfinyToolkit.h
${INFINYTOOLKIT_SRC_DIR}/CollisionDetectionDisplay.h
${INFINYTOOLKIT_SRC_DIR}/RotationEngine.h
${INFINYTOOLKIT_SRC_DIR}/PliersPositionsMapper.h
${INFINYTOOLKIT_SRC_DIR}/HapticEmulator.h
${INFINYTOOLKIT_SRC_DIR}/NeedleTracker.h
${INFINYTOOLKIT_SRC_DIR}/MiddleForceField.h
${INFINYTOOLKIT_SRC_DIR}/MiddleForceField.inl
${INFINYTOOLKIT_SRC_DIR}/ProximityOscillatorConstraint.h
${INFINYTOOLKIT_SRC_DIR}/ProximityOscillatorConstraint.inl
${INFINYTOOLKIT_SRC_DIR}/Triangle2RefinedTriangleTopologicalMapping.h
## Carving tools sections
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/AdvancedCarvingManager.h
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/BaseCarvingPerformer.h
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/SimpleCarvingPerformer.h
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/BurningPerformer.h
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/SurfaceCarvingPerformer.h
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/HapticCarvingManager.h
## Interaction tools sections
${INFINYTOOLKIT_SRC_DIR}/InteractionTools/ArticulatedToolManager.h
${INFINYTOOLKIT_SRC_DIR}/InteractionTools/BaseJawModel.h
${INFINYTOOLKIT_SRC_DIR}/InteractionTools/GrasperJawModel.h
${INFINYTOOLKIT_SRC_DIR}/InteractionTools/ScissorJawModel.h
## Mesh tools sections
${INFINYTOOLKIT_SRC_DIR}/MeshTools/NearestTexcoordsMap.h
${INFINYTOOLKIT_SRC_DIR}/MeshTools/GridBarycentersPositions.h
${INFINYTOOLKIT_SRC_DIR}/BruteForceFeedback.h
## Replay motion controller
${INFINYTOOLKIT_SRC_DIR}/MotionReplayController/MotionReplayController.h
)
set(SOURCE_FILES
${INFINYTOOLKIT_SRC_DIR}/initInfinyToolkit.cpp
${INFINYTOOLKIT_SRC_DIR}/CollisionDetectionDisplay.cpp
${INFINYTOOLKIT_SRC_DIR}/RotationEngine.cpp
${INFINYTOOLKIT_SRC_DIR}/PliersPositionsMapper.cpp
${INFINYTOOLKIT_SRC_DIR}/HapticEmulator.cpp
${INFINYTOOLKIT_SRC_DIR}/NeedleTracker.cpp
${INFINYTOOLKIT_SRC_DIR}/MiddleForceField.cpp
${INFINYTOOLKIT_SRC_DIR}/ProximityOscillatorConstraint.cpp
${INFINYTOOLKIT_SRC_DIR}/Triangle2RefinedTriangleTopologicalMapping.cpp
## Carving tools sections
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/AdvancedCarvingManager.cpp
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/BaseCarvingPerformer.cpp
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/SimpleCarvingPerformer.cpp
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/BurningPerformer.cpp
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/SurfaceCarvingPerformer.cpp
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/HapticCarvingManager.cpp
## Interaction tools sections
${INFINYTOOLKIT_SRC_DIR}/InteractionTools/ArticulatedToolManager.cpp
${INFINYTOOLKIT_SRC_DIR}/InteractionTools/BaseJawModel.cpp
${INFINYTOOLKIT_SRC_DIR}/InteractionTools/GrasperJawModel.cpp
${INFINYTOOLKIT_SRC_DIR}/InteractionTools/ScissorJawModel.cpp
## Mesh tools sections
${INFINYTOOLKIT_SRC_DIR}/MeshTools/NearestTexcoordsMap.cpp
${INFINYTOOLKIT_SRC_DIR}/MeshTools/GridBarycentersPositions.cpp
${INFINYTOOLKIT_SRC_DIR}/BruteForceFeedback.cpp
## Replay motion controller
${INFINYTOOLKIT_SRC_DIR}/MotionReplayController/MotionReplayController.cpp
)
# Add component for carving using refinement mesh
find_package(MeshRefinement QUIET)
if (MeshRefinement_FOUND)
message("MeshRefinement plugin found - Adding it to ${PROJECT_NAME}")
list(APPEND HEADER_FILES
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/RefineCarvingPerformer.h
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/CuttingPerformer.h
)
list(APPEND SOURCE_FILES
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/RefineCarvingPerformer.cpp
${INFINYTOOLKIT_SRC_DIR}/CarvingTools/CuttingPerformer.cpp
)
add_definitions(-DHAS_MESHREFINEMENT_PLUGIN)
endif()
set(README_FILES README.md)
# Create the plugin library.
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES})
# Set define dllimport/dllexport mechanism on Windows.
target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_INFINYTOOLKIT")
# Link the plugin library to its dependencies (other libraries).
target_link_libraries(${PROJECT_NAME}
Sofa.Component.StateContainer
Sofa.Component.MechanicalLoad
Sofa.Component.Topology.Container.Dynamic
Sofa.Component.SolidMechanics.Spring
Sofa.Component.Constraint.Projective
Sofa.Component.Collision.Geometry
Sofa.Component.Controller
Sofa.Component.Haptics
Sofa.GUI.Component
Sofa.Component.Engine.Select
)
if(MeshRefinement_FOUND)
target_link_libraries(${PROJECT_NAME} MeshRefinement)
endif()
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>")
target_include_directories(${PROJECT_NAME} PUBLIC "$<INSTALL_INTERFACE:include>")
## Install rules for the library; CMake package configurations files
sofa_create_package_with_targets(
PACKAGE_NAME ${PROJECT_NAME}
PACKAGE_VERSION ${PROJECT_VERSION}
TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES
INCLUDE_SOURCE_DIR "src"
INCLUDE_INSTALL_DIR ${PROJECT_NAME}
EXAMPLE_INSTALL_DIR "examples"
RELOCATABLE "plugins"
)
# Organize projects into folders
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER "plugins")