-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
93 lines (77 loc) · 3.39 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
cmake_minimum_required(VERSION 3.12)
project(Registration VERSION 0.1)
find_package(Sofa.Helper REQUIRED)
sofa_find_package(Sofa.GL REQUIRED)
sofa_find_package(Sofa.Component.IO.Mesh REQUIRED)
sofa_find_package(Sofa.Component.Engine.Generate REQUIRED)
sofa_find_package(Sofa.Component.Collision.Response.Mapper REQUIRED)
sofa_find_package(SofaDistanceGrid QUIET)
sofa_find_package(image QUIET)
set(REGISTRATION_SRC "src/${PROJECT_NAME}")
set(HEADER_FILES
${REGISTRATION_SRC}/config.h.in
${REGISTRATION_SRC}/ClosestPointRegistrationForceField.h
${REGISTRATION_SRC}/ClosestPointRegistrationForceField.inl
${REGISTRATION_SRC}/GroupwiseRegistrationEngine.h
${REGISTRATION_SRC}/InertiaAlign.h
${REGISTRATION_SRC}/RegistrationContact.h
${REGISTRATION_SRC}/RegistrationContact.inl
${REGISTRATION_SRC}/RegistrationContactForceField.h
${REGISTRATION_SRC}/RegistrationContactForceField.inl
${REGISTRATION_SRC}/RegistrationExporter.h
)
set(SOURCE_FILES
${REGISTRATION_SRC}/ClosestPointRegistrationForceField.cpp
${REGISTRATION_SRC}/GroupwiseRegistrationEngine.cpp
${REGISTRATION_SRC}/InertiaAlign.cpp
${REGISTRATION_SRC}/RegistrationContact.cpp
${REGISTRATION_SRC}/RegistrationContactForceField.cpp
${REGISTRATION_SRC}/RegistrationExporter.cpp
${REGISTRATION_SRC}/initRegistration.cpp
)
set(PYTHON_FILES
python/Registration/__init__.py
python/Registration/sml.py
)
set(README_FILES README.md)
if(image_FOUND)
list(APPEND HEADER_FILES ${REGISTRATION_SRC}/IntensityProfileRegistrationForceField.h)
list(APPEND HEADER_FILES ${REGISTRATION_SRC}/IntensityProfileRegistrationForceField.inl)
list(APPEND SOURCE_FILES ${REGISTRATION_SRC}/IntensityProfileRegistrationForceField.cpp)
list(APPEND HEADER_FILES ${REGISTRATION_SRC}/IntensityProfileCreator.h)
list(APPEND SOURCE_FILES ${REGISTRATION_SRC}/IntensityProfileCreator.cpp)
else()
message(STATUS "Registration: could not find image, won't build IntensityProfileRegistrationForceField")
endif()
# Config files and install rules for pythons scripts
sofa_install_pythonscripts(
PLUGIN_NAME ${PROJECT_NAME}
PYTHONSCRIPTS_SOURCE_DIR "python"
)
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES} ${PYTHON_FILES})
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Component.IO.Mesh Sofa.Component.Collision.Response.Mapper Sofa.Component.Engine.Generate)
target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.GL)
if(image_FOUND)
target_link_libraries(${PROJECT_NAME} PUBLIC image)
endif()
if(SofaDistanceGrid_FOUND)
target_link_libraries(${PROJECT_NAME} PUBLIC SofaDistanceGrid)
else()
message(STATUS "Registration: could not find SofaDistanceGrid, won't build RegistrationContact for RigidDistanceGridCollisionModel.")
endif()
## Install rules for the library; CMake package configurations files
sofa_create_package_with_targets(
PACKAGE_NAME ${PROJECT_NAME}
PACKAGE_VERSION ${Sofa_VERSION}
TARGETS ${PROJECT_NAME} AUTO_SET_TARGET_PROPERTIES
INCLUDE_SOURCE_DIR "src"
INCLUDE_INSTALL_DIR "${PROJECT_NAME}"
RELOCATABLE "plugins"
)
# Tests
# If SOFA_BUILD_TESTS exists and is OFF, then these tests will be auto-disabled
cmake_dependent_option(REGISTRATION_BUILD_TESTS "Compile the automatic tests" ON "SOFA_BUILD_TESTS OR NOT DEFINED SOFA_BUILD_TESTS" OFF)
if(REGISTRATION_BUILD_TESTS)
enable_testing()
add_subdirectory(Registration_test)
endif()