forked from LLNL/MACSio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
125 lines (108 loc) · 3.7 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
122
123
124
125
PROJECT(MACSIO)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(MACSIO_MAJOR_VERSION 1)
SET(MACSIO_MINOR_VERSION 0)
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)
## 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})
## ZFP in HDF5
OPTION(ENABLE_HDF5_ZFP "Enable ZFP compression in HDF5 Layer" OFF)
IF(ENABLE_HDF5_ZFP)
FIND_PACKAGE(ZFP REQUIRED)
INCLUDE_DIRECTORIES(${ZFP_INCLUDE_DIRS})
LIST(APPEND MIO_EXTERNAL_LIBS ${ZFP_LIBRARIES})
ENDIF(ENABLE_HDF5_ZFP)
## 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})
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)
## CONDUIT
OPTION(ENABLE_CONDUIT_PLUGIN "Enable Conduit Layer" OFF)
IF(ENABLE_CONDUIT_PLUGIN)
INCLUDE(${WITH_CONDUIT_PREFIX}/lib/cmake/conduit.cmake)
# FIND_PACKAGE(conduit REQUIRED)
INCLUDE_DIRECTORIES(${WITH_CONDUIT_PREFIX}/include)
IF(ENABLE_MPI)
LIST(APPEND MIO_EXTERNAL_LIBS conduit conduit_blueprint conduit_relay_mpi_io)
ELSE(ENABLE_MPI)
LIST(APPEND MIO_EXTERNAL_LIBS conduit conduit_blueprint conduit_relay)
ENDIF(ENABLE_MPI)
ENDIF(ENABLE_CONDUIT_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)