forked from educelab/volume-cartographer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
141 lines (132 loc) · 3.66 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
project(libvc_meshing VERSION ${VC_VERSION} LANGUAGES CXX)
set(srcs
src/ACVD.cpp
src/CalculateNormals.cpp
src/DeepCopy.cpp
src/ITK2VTK.cpp
src/ScaleMesh.cpp
src/SmoothNormals.cpp
src/OrderedResampling.cpp
src/OrderedPointSetMesher.cpp
src/UVMapToITKMesh.cpp
src/LaplacianSmooth.cpp
)
set(public_deps "")
set(private_deps "")
set(defs "")
add_library(vc_meshing ${srcs})
add_library(VC::meshing ALIAS vc_meshing)
target_compile_definitions(vc_meshing PUBLIC ${defs})
target_include_directories(vc_meshing
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(vc_meshing
PUBLIC
VC::core
${public_deps}
PRIVATE
ITKTransform
VTK::FiltersGeneral
VTK::FiltersCore
ACVD::DiscreteRemeshing
${private_deps}
)
target_compile_features(vc_meshing PUBLIC cxx_std_17)
set_target_properties(vc_meshing PROPERTIES
VERSION "${PROJECT_VERSION}"
EXPORT_NAME meshing
)
if(VC_INSTALL_LIBS)
install(
TARGETS vc_meshing
EXPORT ${targets_export_name}
COMPONENT "Libraries"
ARCHIVE DESTINATION "lib"
LIBRARY DESTINATION "lib"
RUNTIME DESTINATION "bin"
INCLUDES DESTINATION "${include_install_dir}/meshing"
)
install(
DIRECTORY "${include_install_dir}/meshing"
DESTINATION "${include_install_dir}"
COMPONENT "Libraries"
FILES_MATCHING REGEX ".*\.(h|hpp)$"
)
endif()
### Testing ###
if(VC_BUILD_TESTS)
# Set source files
set(test_srcs
test/CalculateNormalsTest.cpp
test/OrderedResamplingTest.cpp
test/ITK2VTKTest.cpp
test/ScaleMeshTest.cpp
test/SmoothNormalsTest.cpp
test/OrderedPointSetMesherTest.cpp
)
# Add a test executable for each src
foreach(src ${test_srcs})
get_filename_component(filename ${src} NAME_WE)
set(testname vc_meshing_${filename})
add_executable(${testname} ${src})
target_link_libraries(${testname}
VC::core
VC::meshing
VC::testing
gtest_main
)
add_test(
NAME ${testname}
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
COMMAND ${testname}
)
endforeach()
# Copy testing resources to bin/ directory
set(ITK_VTK_TEST_RES
test/res/ITKPlaneMeshConvertedToVTK.ply
test/res/ITKCubeMeshConvertedToVTK.ply
test/res/ITKArchMeshConvertedToVTK.ply
test/res/ITKSphereMeshConvertedToVTK.ply
test/res/ITKConeMeshConvertedToVTK.ply
test/res/VTKPlaneMeshConvertedToITK.obj
test/res/VTKCubeMeshConvertedToITK.obj
test/res/VTKArchMeshConvertedToITK.obj
test/res/VTKSphereMeshConvertedToITK.obj
test/res/VTKConeMeshConvertedToITK.obj
)
set(SMOOTH_NORMALS_TEST_RES
test/res/PlaneWithSmoothedNormals.obj
test/res/CubeWithSmoothedNormals.obj
test/res/ArchWithSmoothedNormals.obj
test/res/SphereWithSmoothedNormals.obj
test/res/ConeWithSmoothedNormals.obj
)
set(SCALE_MESH_TEST_RES
test/res/ScaledPlaneMesh.obj
test/res/ScaledCubeMesh.obj
test/res/ScaledArchMesh.obj
test/res/ScaledSphereMesh.obj
test/res/ScaledConeMesh.obj
)
set(ORDERED_RESAMPLING_TEST_RES
test/res/OrderedResampling_Plane.obj
test/res/OrderedResampling_Arch.obj
)
set(ORDERED_POINT_SET_MESHER_TEST_RES
test/res/OrderedPointSetMesher_Plane.obj
test/res/OrderedPointSetMesher_Arch.obj)
set(MESHING_TEST_RES
${ITK_VTK_TEST_RES}
${RAYTRACE_EXAMPLE_TEST_RES}
${RESAMPLED_POINT_CLOUD_TEST_RES}
${SMOOTH_NORMALS_TEST_RES}
${SCALE_MESH_TEST_RES}
${ORDERED_RESAMPLING_TEST_RES}
${ORDERED_POINT_SET_MESHER_TEST_RES}
)
foreach(r ${MESHING_TEST_RES})
file(COPY ${r} DESTINATION ${EXECUTABLE_OUTPUT_PATH})
endforeach()
endif(VC_BUILD_TESTS)