forked from c-wetterer-nelson/catalyst-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (60 loc) · 2.01 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
cmake_minimum_required(VERSION 3.13)
project(CxxFullExampleV2 LANGUAGES C CXX)
include (GNUInstallDirs)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
#------------------------------------------------------------------------------
# since we use C++11 in this example.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Since this example uses MPI, find and link against it.
find_package(MPI COMPONENTS C CXX)
if (NOT MPI_FOUND)
message(STATUS
"Skipping example: ${PROJECT_NAME} requires MPI.")
return ()
endif ()
#------------------------------------------------------------------------------
add_executable(CxxFullExampleV2
FEDataStructures.cxx
FEDataStructures.h
FEDriver.cxx)
target_link_libraries(CxxFullExampleV2
PRIVATE
MPI::MPI_C
MPI::MPI_CXX)
#------------------------------------------------------------------------------
option(USE_CATALYST "Build example with Catalyst enabled" ON)
if (USE_CATALYST)
find_package(catalyst REQUIRED
PATHS "${ParaView_DIR}/catalyst")
target_compile_definitions(CxxFullExampleV2
PRIVATE
"PARAVIEW_IMPL_DIR=\"${ParaView_CATALYST_DIR}\""
USE_CATALYST=1)
target_link_libraries(CxxFullExampleV2
PRIVATE
catalyst::catalyst)
include(CTest)
if (BUILD_TESTING)
add_test(
NAME CxxFullExampleV2::SimplePipeline
COMMAND CxxFullExampleV2
${CMAKE_CURRENT_SOURCE_DIR}/catalyst_pipeline.py)
set(_vtk_fail_regex
# CatalystAdaptor
"Failed"
# vtkLogger
"(\n|^)ERROR: "
"ERR\\|"
# vtkDebugLeaks
"instance(s)? still around")
set_tests_properties("CxxFullExampleV2::SimplePipeline"
PROPERTIES
FAIL_REGULAR_EXPRESSION "${_vtk_fail_regex}"
PASS_REGULAR_EXPRESSION "executing catalyst_pipeline"
SKIP_REGULAR_EXPRESSION "Python support not enabled"
SKIP_RETURN_CODE 125)
endif()
endif()