forked from romangrothausmann/FacetAnalyser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
77 lines (60 loc) · 2.6 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.8)
#Change PROJECT_NAME to the name of your project
PROJECT(FacetAnalyser)
#The following lines are required to use Dart
ENABLE_TESTING()
INCLUDE(CTest)
include(GNUInstallDirs)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set(BUILD_SHARED_LIBS ON)
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
INCLUDE_DIRECTORIES(${ITK_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/third-party/VtkGlue/include/)
LINK_DIRECTORIES(${ITK_LIBRARY_DIRS})
LINK_LIBRARIES(${ITK_LIBRARIES})
#FIND_PACKAGE(VTK REQUIRED)
#INCLUDE(${VTK_USE_FILE})
FIND_PACKAGE(ParaView REQUIRED)
LINK_LIBRARIES(${VTK_LIBRARIES})
# build the plugin
set("_paraview_plugin_default_${CMAKE_PROJECT_NAME}" ON)
paraview_plugin_scan(
PLUGIN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Plugin/paraview.plugin"
ENABLE_BY_DEFAULT ON
PROVIDES_PLUGINS plugins
REQUIRES_MODULES required_modules)
foreach (module IN LISTS required_modules)
if (NOT TARGET "${module}")
message(#FATAL_ERROR
"Skipping example ${CMAKE_PROJECT_NAME}: Missing required module: "
"${module}")
return ()
endif ()
endforeach ()
paraview_plugin_build(
RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY_SUBDIRECTORY "${PARAVIEW_PLUGIN_SUBDIR}"
PLUGINS ${plugins}
)
# tests
add_test(
NAME basicPluginTest01
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/demos/
COMMAND pvpython ${PROJECT_SOURCE_DIR}/scripts/pvsm2webgl.py -i 8faced-rhombic-dodecahedron_twinned_simp+def_PVplugin.pvsm -o ${PROJECT_SOURCE_DIR}/docs/demos/WebGL/8faced-rhombic-dodecahedron_twinned_simp+def_PVplugin.webgl -p ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/${PARAVIEW_PLUGIN_SUBDIR}/FacetAnalyser/FacetAnalyser.so
)
set_property(
TEST basicPluginTest01
PROPERTY SKIP_REGULAR_EXPRESSION "AttributeError"
)
add_test(
NAME basicPluginTest02
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/demos/
COMMAND pvpython ${PROJECT_SOURCE_DIR}/scripts/pvsm2x3d.py -i 8faced-rhombic-dodecahedron_twinned_simp+def_PVplugin.pvsm -o ../docs/demos/X3D/8faced-rhombic-dodecahedron_twinned_simp+def_PVplugin.x3d -p ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/${PARAVIEW_PLUGIN_SUBDIR}/FacetAnalyser/FacetAnalyser.so
) # relative path as it is stored in X3D
set_property(
TEST basicPluginTest02
PROPERTY SKIP_REGULAR_EXPRESSION "AttributeError"
)