-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
121 lines (103 loc) · 3.38 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
PROJECT(MACSIO)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
ENABLE_TESTING()
SET(MACSIO_MAJOR_VERSION 1)
SET(MACSIO_MINOR_VERSION 1)
SET(MACSIO_PATCH_VERSION 0)
SET(MACSIO_VERSION
"${MACSIO_MAJOR_VERSION}.${MACSIO_MINOR_VERSION}.${MACSIO_PATCH_VERSION}")
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
ENDIF(NOT CMAKE_BUILD_TYPE)
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
## JSON-CWX
FIND_PACKAGE(JSON-CWX REQUIRED)
INCLUDE_DIRECTORIES(${JSON-CWX_INCLUDE_DIRS})
LIST(APPEND MIO_EXTERNAL_LIBS ${JSON-CWX_LIBRARIES})
## MPI
OPTION(ENABLE_MPI "Enable MPI" ON)
IF(ENABLE_MPI)
INCLUDE(SetupMPI)
INCLUDE_DIRECTORIES(${MPI_C_INCLUDE_PATH})
LIST(APPEND MIO_EXTERNAL_LIBS ${MPI_CXX_LIBRARIES})
ENDIF(ENABLE_MPI)
## Caliper
OPTION(ENABLE_CALIPER "Enable Caliper" OFF)
IF (ENABLE_CALIPER)
FIND_PACKAGE(caliper REQUIRED)
INCLUDE_DIRECTORIES(${caliper_INCLUDE_DIR})
LIST(APPEND MIO_EXTERNAL_LIBS caliper)
IF (ENABLE_MPI)
LIST(APPEND MIO_EXTERNAL_LIBS caliper-mpi)
ENDIF(ENABLE_MPI)
SET(HAVE_CALIPER TRUE)
ADD_DEFINITIONS(-DHAVE_CALIPER)
ENDIF(ENABLE_CALIPER)
## SILO
OPTION(ENABLE_SILO_PLUGIN "Enable SILO Layer" ON)
IF(ENABLE_SILO_PLUGIN)
FIND_PACKAGE(SILO REQUIRED)
INCLUDE_DIRECTORIES(${SILO_INCLUDE_DIRS})
LIST(APPEND MIO_EXTERNAL_LIBS ${SILO_LIBRARIES})
ENDIF(ENABLE_SILO_PLUGIN)
## PBD
OPTION(ENABLE_PDB_PLUGIN "Enable PDB Layer" OFF)
IF(ENABLE_PDB_PLUGIN)
IF(NOT SILO_FOUND)
FIND_PACKAGE(SILO REQUIRED)
INCLUDE_DIRECTORIES(${SILO_INCLUDE_DIRS})
LIST(APPEND MIO_EXTERNAL_LIBS ${SILO_LIBRARIES})
ENDIF(NOT SILO_FOUND)
ADD_DEFINITIONS(-DHAVE_SILO)
SET(HAVE_SILO TRUE)
ENDIF(ENABLE_PDB_PLUGIN)
## HDF5
OPTION(ENABLE_HDF5_PLUGIN "Enable HDF5 Layer" OFF)
IF(ENABLE_HDF5_PLUGIN)
FIND_PACKAGE(HDF5 REQUIRED)
INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS})
LIST(APPEND MIO_EXTERNAL_LIBS ${HDF5_LIBRARIES})
## SZIP in HDF5
OPTION(ENABLE_HDF5_SZIP "Enable SZIP compression in HDF5 Layer" OFF)
IF(ENABLE_HDF5_SZIP)
FIND_PACKAGE(SZIP REQUIRED)
INCLUDE_DIRECTORIES(${SZIP_INCLUDE_DIRS})
LIST(APPEND MIO_EXTERNAL_LIBS ${SZIP_LIBRARIES})
ADD_DEFINITIONS(-DHAVE_SZIP=1)
ENDIF(ENABLE_HDF5_SZIP)
## ZLIB in HDF5
OPTION(ENABLE_HDF5_ZLIB "Enable ZLIB compression in HDF5 Layer" OFF)
IF(ENABLE_HDF5_ZLIB)
FIND_PACKAGE(ZLIB REQUIRED)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
LIST(APPEND MIO_EXTERNAL_LIBS ${ZLIB_LIBRARIES})
ENDIF(ENABLE_HDF5_ZLIB)
ENDIF(ENABLE_HDF5_PLUGIN)
## TYPHONIO
OPTION(ENABLE_TYPHONIO_PLUGIN "Enable TYPHONIO Layer" OFF)
IF(ENABLE_TYPHONIO_PLUGIN)
FIND_PACKAGE(TYPHONIO REQUIRED)
INCLUDE_DIRECTORIES(${TYPHONIO_INCLUDE_DIRS})
LIST(APPEND MIO_EXTERNAL_LIBS ${TYPHONIO_LIBRARIES})
ENDIF(ENABLE_TYPHONIO_PLUGIN)
## EXODUS
OPTION(ENABLE_EXODUS_PLUGIN "Enable EXODUS Layer" OFF)
IF(ENABLE_EXODUS_PLUGIN)
FIND_PACKAGE(EXODUS REQUIRED)
INCLUDE_DIRECTORIES(${EXODUS_INCLUDE_DIRS})
LIST(APPEND MIO_EXTERNAL_LIBS ${EXODUS_LIBRARIES})
FIND_PACKAGE(NETCDF REQUIRED) ## NETCDF REQUIRED FOR EXODUS
INCLUDE_DIRECTORIES(${NETCDF_INCLUDE_DIRS})
LIST(APPEND MIO_EXTERNAL_LIBS ${NETCDF_LIBRARIES})
ENDIF(ENABLE_EXODUS_PLUGIN)
## Installing things the linux way
INCLUDE(GNUInstallDirs)
# Subdirectories
ADD_SUBDIRECTORY(plugins)
INCLUDE_DIRECTORIES(plugins)
ADD_SUBDIRECTORY(macsio)
OPTION(BUILD_DOCS "Build MACSio Doxygen documentation?" OFF)
IF(BUILD_DOCS)
FIND_PACKAGE(Doxygen REQUIRED)
ADD_SUBDIRECTORY(doc)
ENDIF(BUILD_DOCS)