CMakeLists.txt 3.44 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#-----------------------------------------------------------------------
set (sources
  AnalysisAdaptor.cxx
  AnalysisAdaptor.h
  Autocorrelation.cxx
  Autocorrelation.h
  ConfigurableAnalysis.cxx
  ConfigurableAnalysis.h
  DataAdaptor.cxx
  DataAdaptor.h
11
12
  Histogram.cxx
  Histogram.h
Burlen Loring's avatar
Burlen Loring committed
13
14
15
  PosthocIO.cxx
  PosthocIO.h
  )
16
17
18
19
20
21
if(ENABLE_VTK_XMLP)
  list(APPEND sources
    vtk/DataAdaptor.cxx
    vtk/DataAdaptor.h
    )
endif()
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

if(ENABLE_CATALYST)
  list(APPEND sources
    catalyst/AnalysisAdaptor.cxx
    catalyst/AnalysisAdaptor.h
    catalyst/Slice.cxx
    catalyst/Slice.h)
endif()
if(ENABLE_ADIOS)
  list(APPEND sources
    adios/AnalysisAdaptor.cxx
    adios/AnalysisAdaptor.h
    adios/DataAdaptor.cxx
    adios/DataAdaptor.h)
endif()
37
38
39
if(ENABLE_LIBSIM)
  list(APPEND sources
    libsim/AnalysisAdaptor.cxx
40
41
42
    libsim/AnalysisAdaptor.h
    libsim/ImageProperties.cxx
    libsim/ImageProperties.h)
43
endif()
44
45
46
47
48
49

#-----------------------------------------------------------------------
add_library(sensei STATIC ${sources})
target_compile_definitions(sensei INTERFACE ENABLE_SENSEI)

if(ENABLE_CATALYST)
50
51
52
53
54
  set(CATALYST_PYTHON_MODULE)
  if(ENABLE_CATALYST_PYTHON)
    set(CATALYST_PYTHON_MODULE "vtkPVPythonCatalyst")
  endif()

55
56
  find_package(ParaView QUIET COMPONENTS vtkPVCatalyst vtkCommonDataModel
    vtkPVServerManagerRendering ${CATALYST_PYTHON_MODULE})
57
58
59
60
61
62
63
64
65
  if(NOT ParaView_FOUND)
    message(FATAL_ERROR "Catalyst analysis components require Catalyst build (or "
                        "install directory. Please set ParaView_DIR to point to "
                        "directory containing `ParaViewConfig.cmake`.")
  endif()
  target_include_directories(sensei SYSTEM PUBLIC ${PARAVIEW_INCLUDE_DIRS})
  target_compile_definitions(sensei PUBLIC ${VTK_DEFINITIONS})
  target_link_libraries(sensei PUBLIC ${VTK_LIBRARIES})
  target_compile_definitions(sensei PUBLIC ENABLE_CATALYST)
66
67
68
  if(ENABLE_CATALYST_PYTHON)
    target_compile_definitions(sensei PUBLIC ENABLE_CATALYST_PYTHON)
  endif()
69
else()
Burlen Loring's avatar
Burlen Loring committed
70
71
72
73
74
  set(SENSEI_VTK_DEPS vtkCommonDataModel)
  if (ENABLE_VTK_XMLP)
    list(APPEND SENSEI_VTK_DEPS vtkParallelMPI vtkIOParallelXML)
  endif()
  find_package(VTK QUIET COMPONENTS ${SENSEI_VTK_DEPS})
75
  if(NOT VTK_FOUND)
Burlen Loring's avatar
Burlen Loring committed
76
77
78
    message(FATAL_ERROR "VTK (${SENSEI_VTK_DEPS}) modules are required for "
      "Sensei core even when not using any infrastructures. Please set "
      "VTK_DIR to point to a directory containing `VTKConfig.cmake`.")
79
80
81
82
83
84
  endif()
  target_include_directories(sensei SYSTEM PUBLIC ${VTK_INCLUDE_DIRS})
  target_compile_definitions(sensei PUBLIC ${VTK_DEFINITIONS})
endif()

if(VTK_HAS_GENERIC_ARRAYS)
85
  target_compile_definitions(sensei PRIVATE VTK_HAS_GENERIC_ARRAYS)
86
87
88
89
endif()

if(ENABLE_ADIOS)
  target_link_libraries(sensei PRIVATE adios)
90
  target_compile_definitions(sensei PUBLIC ENABLE_ADIOS)
91
92
endif()

93
if(ENABLE_LIBSIM)
94
  target_include_directories(sensei SYSTEM PUBLIC ${LIBSIM_INCLUDE_DIR})
95
  target_link_libraries(sensei PRIVATE libsim)
96
  target_compile_definitions(sensei PUBLIC ENABLE_LIBSIM)
97
98
endif()

Burlen Loring's avatar
Burlen Loring committed
99
100
101
102
if (ENABLE_VTK_XMLP)
  target_compile_definitions(sensei PUBLIC ENABLE_VTK_XMLP)
endif()

103
target_link_libraries(sensei
Burlen Loring's avatar
Burlen Loring committed
104
  PUBLIC ${VTK_LIBRARIES}
105
106
107
108
          mpi
  PRIVATE diy
          grid
          pugixml
109
          timer
Burlen Loring's avatar
Burlen Loring committed
110
          ArrayIO
111
112
  )

Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
113
#------------------------------------------------------------------------------
114
# Needed by Autocorrelation.cxx
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
115
116
find_package(Threads)
target_link_libraries(sensei PUBLIC ${CMAKE_THREAD_LIBS_INIT})
117
target_compile_features(sensei PUBLIC cxx_auto_type)