-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
153 lines (124 loc) · 6.21 KB
/
CMakeLists.txt
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
##############################################################################
# Copyright (C) - InfinyTech3D - All Rights Reserved #
# #
# Unauthorized copying of this file, via any medium is strictly prohibited #
# Proprietary and confidential. #
# #
# Written by Erik Pernod <[email protected]>, September 2019 #
##############################################################################
cmake_minimum_required(VERSION 3.12)
project(InfinyToolkit VERSION 0.1)
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)
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}/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
)
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}/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
)
# 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
)
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}
RELOCATABLE "plugins"
)
# Organize projects into folders
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER "plugins")