forked from sofa-framework/BeamAdapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
154 lines (116 loc) · 5.99 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
154
cmake_minimum_required(VERSION 3.12)
project(BeamAdapter VERSION 1.0)
include(cmake/environment.cmake)
find_package(SofaFramework REQUIRED)
find_package(SofaImplicitField QUIET)
find_package(SofaAdvancedConstraint QUIET)
set(BEAMADAPTER_SRC "src/${PROJECT_NAME}")
set(HEADER_FILES
${BEAMADAPTER_SRC}/config.h.in
${BEAMADAPTER_SRC}/initBeamAdapter.h
${BEAMADAPTER_SRC}/component/BeamInterpolation.h
${BEAMADAPTER_SRC}/component/BeamInterpolation.inl
${BEAMADAPTER_SRC}/component/WireBeamInterpolation.h
${BEAMADAPTER_SRC}/component/WireBeamInterpolation.inl
${BEAMADAPTER_SRC}/component/constraint/AdaptiveBeamSlidingConstraint.h
${BEAMADAPTER_SRC}/component/constraint/AdaptiveBeamSlidingConstraint.inl
${BEAMADAPTER_SRC}/component/constraint/AdaptiveBeamLengthConstraint.h
${BEAMADAPTER_SRC}/component/constraint/AdaptiveBeamLengthConstraint.inl
${BEAMADAPTER_SRC}/component/controller/AdaptiveBeamController.h
${BEAMADAPTER_SRC}/component/controller/AdaptiveBeamController.inl
${BEAMADAPTER_SRC}/component/controller/InterventionalRadiologyController.h
${BEAMADAPTER_SRC}/component/controller/InterventionalRadiologyController.inl
${BEAMADAPTER_SRC}/component/controller/SutureController.h
${BEAMADAPTER_SRC}/component/controller/SutureController.inl
${BEAMADAPTER_SRC}/component/engine/WireRestShape.h
${BEAMADAPTER_SRC}/component/engine/WireRestShape.inl
${BEAMADAPTER_SRC}/component/engine/SteerableCatheter.h
${BEAMADAPTER_SRC}/component/engine/SteerableCatheter.inl
${BEAMADAPTER_SRC}/component/forcefield/AdaptiveBeamForceFieldAndMass.h
${BEAMADAPTER_SRC}/component/forcefield/AdaptiveBeamForceFieldAndMass.inl
${BEAMADAPTER_SRC}/component/forcefield/AdaptiveInflatableBeamForceField.h
${BEAMADAPTER_SRC}/component/forcefield/AdaptiveInflatableBeamForceField.inl
${BEAMADAPTER_SRC}/component/mapping/AdaptiveBeamMapping.h
${BEAMADAPTER_SRC}/component/mapping/AdaptiveBeamMapping.inl
${BEAMADAPTER_SRC}/component/mapping/MultiAdaptiveBeamMapping.h
${BEAMADAPTER_SRC}/component/mapping/MultiAdaptiveBeamMapping.inl
${BEAMADAPTER_SRC}/utils/deprecatedcomponent.h
)
set(SOURCE_FILES
${BEAMADAPTER_SRC}/initBeamAdapter.cpp
${BEAMADAPTER_SRC}/component/BeamInterpolation.cpp
${BEAMADAPTER_SRC}/component/WireBeamInterpolation.cpp
${BEAMADAPTER_SRC}/component/constraint/AdaptiveBeamSlidingConstraint.cpp
${BEAMADAPTER_SRC}/component/constraint/AdaptiveBeamLengthConstraint.cpp
${BEAMADAPTER_SRC}/component/controller/AdaptiveBeamController.cpp
${BEAMADAPTER_SRC}/component/controller/InterventionalRadiologyController.cpp
${BEAMADAPTER_SRC}/component/controller/SutureController.cpp
${BEAMADAPTER_SRC}/component/engine/WireRestShape.cpp
${BEAMADAPTER_SRC}/component/engine/SteerableCatheter.cpp
${BEAMADAPTER_SRC}/component/forcefield/AdaptiveBeamForceFieldAndMass.cpp
${BEAMADAPTER_SRC}/component/forcefield/AdaptiveInflatableBeamForceField.cpp
${BEAMADAPTER_SRC}/component/mapping/AdaptiveBeamMapping.cpp
${BEAMADAPTER_SRC}/component/mapping/MultiAdaptiveBeamMapping.cpp
)
set(README_FILE "README.md" )
if(SofaImplicitField_FOUND)
set(HEADER_FILES ${HEADER_FILES}
${BEAMADAPTER_SRC}/component/constraint/ImplicitSurfaceAdaptiveConstraint.h
${BEAMADAPTER_SRC}/component/constraint/ImplicitSurfaceAdaptiveConstraint.inl
)
set(SOURCE_FILES ${SOURCE_FILES}
${BEAMADAPTER_SRC}/component/constraint/ImplicitSurfaceAdaptiveConstraint.cpp
)
endif()
if(SofaAdvancedConstraint_FOUND)
set(HEADER_FILES ${HEADER_FILES}
${BEAMADAPTER_SRC}/component/AdaptiveBeamContactMapper.h
${BEAMADAPTER_SRC}/component/AdaptiveBeamContactMapper.inl
# ${BEAMADAPTER_SRC}/component/AdaptiveBeamFrictionContact.h
# ${BEAMADAPTER_SRC}/component/AdaptiveBeamFrictionContact.inl
${BEAMADAPTER_SRC}/component/MultiAdaptiveBeamContactMapper.h
${BEAMADAPTER_SRC}/component/MultiAdaptiveBeamContactMapper.inl
)
set(SOURCE_FILES ${SOURCE_FILES}
${BEAMADAPTER_SRC}/component/AdaptiveBeamContactMapper.cpp
${BEAMADAPTER_SRC}/component/AdaptiveBeamFrictionContact.cpp
${BEAMADAPTER_SRC}/component/MultiAdaptiveBeamContactMapper.cpp
)
#find_package(CUDA REQUIRED)
#cuda_include_directories(${SOFA_CUDA_DIR})
#cuda_include_directories(${SOFA_FRAMEWORK_DIR})
#cuda_add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${CUDA_SOURCES})
endif()
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_BEAMADAPTER")
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>")
target_include_directories(${PROJECT_NAME} PUBLIC "$<INSTALL_INTERFACE:include>")
target_link_libraries(${PROJECT_NAME} Sofa.Helper Sofa.Core SofaConstraint SofaBaseMechanics SofaUserInteraction SofaImplicitField Sofa.GL)
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"
)
option(BEAMADAPTER_BUILD_TESTS "Build unit tests" ON)
if(BEAMADAPTER_BUILD_TESTS)
add_subdirectory(BeamAdapter_test)
endif()
# this paragraph has not been ported to the new build system yet...
#if(SOFA-PLUGIN_SOFAADVANCEDCONSTRAINT)
#set(LINKER_DEPENDENCIES SofaAdvancedConstraint)
#list(APPEND LINKER_DEPENDENCIES SofaCUDA)
#list(APPEND LINKER_DEPENDENCIES SofaCUDADev)
#set(LINKER_DEPENDENCIES SofaAdvancedConstraint)
#endif()
#
# Organize projects into folders
#
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SET_PROPERTY(TARGET ${PROJECT_NAME} PROPERTY FOLDER "plugins")
# Config files and install rules for pythons scripts
sofa_set_python_directory(${PROJECT_NAME} "python3/beamadapter")
include(cmake/packaging.cmake)