CMakeLists.txt 2.69 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
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

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()

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

if(ENABLE_CATALYST)
  find_package(ParaView QUIET COMPONENTS vtkPVCatalyst vtkCommonDataModel)
  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)
else()
Burlen Loring's avatar
Burlen Loring committed
48
49
50
51
52
  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})
53
  if(NOT VTK_FOUND)
Burlen Loring's avatar
Burlen Loring committed
54
55
56
    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`.")
57
58
59
60
61
62
  endif()
  target_include_directories(sensei SYSTEM PUBLIC ${VTK_INCLUDE_DIRS})
  target_compile_definitions(sensei PUBLIC ${VTK_DEFINITIONS})
endif()

if(VTK_HAS_GENERIC_ARRAYS)
63
  target_compile_definitions(sensei PRIVATE VTK_HAS_GENERIC_ARRAYS)
64
65
66
67
endif()

if(ENABLE_ADIOS)
  target_link_libraries(sensei PRIVATE adios)
68
  target_compile_definitions(sensei PUBLIC ENABLE_ADIOS)
69
70
endif()

Burlen Loring's avatar
Burlen Loring committed
71
72
73
74
if (ENABLE_VTK_XMLP)
  target_compile_definitions(sensei PUBLIC ENABLE_VTK_XMLP)
endif()

75
target_link_libraries(sensei
Burlen Loring's avatar
Burlen Loring committed
76
  PUBLIC ${VTK_LIBRARIES}
77
78
79
80
          mpi
  PRIVATE diy
          grid
          pugixml
81
          timer
Burlen Loring's avatar
Burlen Loring committed
82
          ArrayIO
83
84
  )

Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
85
#------------------------------------------------------------------------------
86
# Needed by Autocorrelation.cxx
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
87
88
find_package(Threads)
target_link_libraries(sensei PUBLIC ${CMAKE_THREAD_LIBS_INIT})
89
target_compile_features(sensei PUBLIC cxx_auto_type)