forked from sci-visus/PIDX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
162 lines (128 loc) · 5.04 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#/*****************************************************
# ** PIDX Parallel I/O Library **
# ** Copyright (c) 2010-2014 University of Utah **
# ** Scientific Computing and Imaging Institute **
# ** 72 S Central Campus Drive, Room 3750 **
# ** Salt Lake City, UT 84112 **
# ** **
# ** PIDX is licensed under the Creative Commons **
# ** Attribution-NonCommercial-NoDerivatives 4.0 **
# ** International License. See LICENSE.md. **
# ** **
# ** For information about this project see: **
# ** http://www.cedmav.com/pidx **
# ** or contact: pascucci@sci.utah.edu **
# ** For support: PIDX-support@visus.net **
# ** **
# *****************************************************/
cmake_minimum_required(VERSION 2.8)
PROJECT(PIDX)
# ///////////////////////////////////////////////
# Cmake configurations
# ///////////////////////////////////////////////
SET(CMAKE_NUM_PROCS 8)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
SET(CMAKE_VERBOSE_MAKEFILE OFF CACHE BOOL "Use a verbose makefile")
OPTION(BUILD_SHARED_LIBS "Build shared libraries." FALSE)
OPTION(ENABLE_MPI "Enable MPI." TRUE)
# ///////////////////////////////////////////////
# external packages
# ///////////////////////////////////////////////
IF (ENABLE_MPI)
FIND_PACKAGE(MPI REQUIRED)
IF (MPI_C_FOUND)
SET(PIDX_HAVE_MPI 1)
ENDIF()
ENDIF()
# ///////////////////////////////////////////////
# platform configuration
# ///////////////////////////////////////////////
INCLUDE(PIDXPlatform)
INCLUDE(PIDXMacros)
PIDX_SET_COMPILER_OPTIONS()
PIDX_SET_MACHINE_SPECIFIC_OPTIONS()
# ///////////////////////////////////////////////
# PIDX_GIT_REVISION
# ///////////////////////////////////////////////
FIND_PROGRAM(GIT_CMD git)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GIT REQUIRED_VARS GIT_CMD)
IF (GIT_CMD)
EXECUTE_PROCESS(COMMAND ${GIT_CMD} rev-list -n 1 HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE PIDX_GIT_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE)
SET(${result} TEMP_VAR)
ELSE()
SET(PIDX_GIT_REVISION "")
ENDIF()
MESSAGE("PIDX_GIT_REVISION ${PIDX_GIT_REVISION}")
# ///////////////////////////////////////////////
# PIDX_BUILD_XXXX
# ///////////////////////////////////////////////
OPTION(PIDX_BUILD_TUTORIAL "Build tutorial" FALSE)
MESSAGE("PIDX_BUILD_TUTORIAL ${PIDX_BUILD_TUTORIAL}")
OPTION(PIDX_BUILD_EXAMPLE "Build example" FALSE)
MESSAGE("PIDX_BUILD_EXAMPLE ${PIDX_BUILD_EXAMPLE}")
OPTION(PIDX_BUILD_CONVERT "Build pidx convert tools" FALSE)
MESSAGE("PIDX_BUILD_CONVERT ${PIDX_BUILD_CONVERT}")
OPTION(PIDX_BUILD_PROFILE "pidx profile tools" FALSE)
MESSAGE("PIDX_BUILD_PROFILE ${PIDX_BUILD_PROFILE}")
# ///////////////////////////////////////////////
# PIDX_OPTION_XXXX
# ///////////////////////////////////////////////
#SET(PIDX_OPTION_ZFP 0)
OPTION(PIDX_OPTION_ZFP "Enable ZFP." FALSE)
MESSAGE("PIDX_OPTION_ZFP ${PIDX_OPTION_ZFP}")
IF (PIDX_OPTION_ZFP)
SET(PIDX_HAVE_ZFP 1)
ENDIF()
OPTION(PIDX_OPTION_NVISUSIO "Test nvisusio library (hint: set CMAKE_MODULE_PATH to path of ViSUS installation)." FALSE)
MESSAGE("PIDX_OPTION_NVISUSIO ${PIDX_OPTION_NVISUSIO}")
IF (PIDX_OPTION_NVISUSIO)
FIND_PACKAGE(NVISUSIO REQUIRED)
IF (NVISUSIO_FOUND)
SET(PIDX_HAVE_NVISUSIO 1)
ENDIF()
ENDIF()
MESSAGE("PIDX_OPTION_PNETCDF ${PIDX_OPTION_PNETCDF}")
OPTION(PIDX_OPTION_PNETCDF "Test Pnetcdf (netcdf-1)" FALSE)
IF (PIDX_OPTION_PNETCDF)
FIND_PACKAGE(PNETCDF REQUIRED)
IF (PNETCDF_FOUND)
SET(PIDX_HAVE_PNETCDF 1)
ENDIF()
ENDIF()
MESSAGE("PIDX_OPTION_NETCDF ${PIDX_OPTION_NETCDF}")
OPTION(PIDX_OPTION_NETCDF "Test parallel netcdf-4" FALSE)
IF (PIDX_OPTION_NETCDF)
FIND_PACKAGE(NETCDF REQUIRED)
IF (NETCDF_FOUND)
SET(PIDX_HAVE_NETCDF 1)
ENDIF()
ENDIF()
MESSAGE("PIDX_OPTION_HDF5 ${PIDX_OPTION_HDF5}")
OPTION(PIDX_OPTION_HDF5 "Test HDF5" FALSE)
IF (PIDX_OPTION_HDF5)
FIND_PACKAGE(HDF5 REQUIRED)
IF (HDF5_FOUND)
SET(PIDX_HAVE_HDF5 1)
ENDIF()
ENDIF()
# ///////////////////////////////////////////////
# configuration
# ///////////////////////////////////////////////
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/PIDX_config.h.in" "${PROJECT_BINARY_DIR}/PIDX_config.h" )
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
# ///////////////////////////////////////////////
# subdirectories
# ///////////////////////////////////////////////
ADD_SUBDIRECTORY(external)
ADD_SUBDIRECTORY(pidx)
ADD_SUBDIRECTORY(tutorial)
ADD_SUBDIRECTORY(profile)
# ADD_SUBDIRECTORY(examples)
# ///////////////////////////////////////////////
# installation
# ///////////////////////////////////////////////
MESSAGE("CMAKE_INSTALL_PREFIX is " ${CMAKE_INSTALL_PREFIX})
INSTALL(DIRECTORY pidx/ DESTINATION include FILES_MATCHING PATTERN "*.h")
INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindPIDX.cmake" DESTINATION .)
INSTALL(FILES "${PROJECT_BINARY_DIR}/PIDX_config.h" DESTINATION include)