-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
222 lines (195 loc) · 6.96 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
cmake_minimum_required(VERSION 3.12)
project (H5PL C)
if (POLICY CMP0074)
# find_package() uses <PackageName>_ROOT variables.
cmake_policy (SET CMP0074 NEW)
endif ()
if (POLICY CMP0083)
# To control generation of Position Independent Executable (PIE) or not,
# some flags are required at link time.
cmake_policy (SET CMP0083 NEW)
endif ()
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()
#-----------------------------------------------------------------------------
# Basic H5PL stuff here
#-----------------------------------------------------------------------------
include (${H5PL_SOURCE_DIR}/config/cmake/HDFMacros.cmake)
include (${H5PL_SOURCE_DIR}/config/cmake/HDFPluginMacros.cmake)
SET_HDF_BUILD_TYPE()
set (H5PL_EXPORTED_TARGETS "")
BASIC_SETTINGS (${PL_PACKAGE_NAME})
if (NOT H5PL_VERS_MAJOR)
set (H5PL_VERS_MAJOR "2")
endif ()
if (NOT H5PL_VERS_MINOR)
set (H5PL_VERS_MINOR "0")
endif ()
if (NOT H5PL_VERS_RELEASE)
set (H5PL_VERS_RELEASE "0")
endif ()
set (H5PL_OVERRIDE_VERSION "${H5PL_VERS_MAJOR}.${H5PL_VERS_MINOR}.${H5PL_VERS_RELEASE}")
set (H5PL_SOVERS_MAJOR 1)
set (H5PL_SOVERS_MINOR 0)
set (H5PL_SOVERS_INTERFACE 4)
set (H5PL_SOVERS_RELEASE 0)
math (EXPR H5PL_SOVERS_MAJOR ${H5PL_SOVERS_INTERFACE}-${H5PL_SOVERS_RELEASE})
set (H5PL_PACKAGE_VERSION "${H5PL_VERS_MAJOR}.${H5PL_VERS_MINOR}.${H5PL_VERS_RELEASE}")
set (H5PL_PACKAGE_VERSION_STRING "${H5PL_PACKAGE_VERSION}")
set (H5PL_PACKAGE_VERSION_MAJOR "${H5PL_VERS_MAJOR}")
set (H5PL_PACKAGE_VERSION_MINOR "${H5PL_VERS_MINOR}")
set (H5PL_PACKAGE_STRING "${H5PL_PACKAGE_NAME}")
set (H5PL_PACKAGE_TARNAME "${H5PL_PACKAGE_NAME}${HDF_PACKAGE_EXT}")
set (H5PL_PACKAGE_URL "http://www.hdfgroup.org")
set (H5PL_PACKAGE_BUGREPORT "help@hdfgroup.org")
#-----------------------------------------------------------------------------
# Include some macros for reusable code
#-----------------------------------------------------------------------------
include (${H5PL_RESOURCES_DIR}/H5PLMacros.cmake)
#-----------------------------------------------------------------------------
# HDF5 support
#-----------------------------------------------------------------------------
HDF5_SUPPORT (TRUE)
message (STATUS "HDF5 link libs: ${H5PL_LINK_LIBS}")
#-----------------------------------------------------------------------------
# External plugin targets for the H5PL super project.
#-----------------------------------------------------------------------------
include (ExternalProject)
set (H5PL_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)")
set_property (CACHE H5PL_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ)
# Bitshuffle filter
if (NOT CMAKE_C_COMPILER_ID MATCHES "Intel[Ll][Ll][Vv][Mm]")
FILTER_OPTION (BSHUF)
else ()
set (ENABLE_BSHUF OFF CACHE BOOL "" FORCE)
endif ()
# BLOSC filter
if (WIN32)
if (NOT CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" AND MSVC_VERSION GREATER 1600)
FILTER_OPTION (BLOSC)
else ()
set (ENABLE_BLOSC OFF CACHE BOOL "" FORCE)
endif ()
elseif (APPLE)
if (NOT CMAKE_C_COMPILER_ID MATCHES "Intel")
FILTER_OPTION (BLOSC)
elseif (CMAKE_C_COMPILER_ID MATCHES "Intel[Ll][Ll][Vv][Mm]")
FILTER_OPTION (BLOSC)
else ()
set (ENABLE_BLOSC OFF CACHE BOOL "" FORCE)
endif ()
else ()
FILTER_OPTION (BLOSC)
endif ()
# BLOSC2 filter
if (WIN32)
if (NOT CMAKE_C_COMPILER_ID MATCHES "Intel[Ll][Ll][Vv][Mm]")
if (NOT CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" AND MSVC_VERSION GREATER 1600)
FILTER_OPTION (BLOSC2)
else ()
set (ENABLE_BLOSC2 OFF CACHE BOOL "" FORCE)
endif ()
else ()
set (ENABLE_BLOSC2 OFF CACHE BOOL "" FORCE)
endif ()
elseif (APPLE)
if (CMAKE_C_COMPILER_ID MATCHES "Intel[Ll][Ll][Vv][Mm]")
FILTER_OPTION (BLOSC2)
elseif (NOT CMAKE_C_COMPILER_ID MATCHES "Intel" AND NOT CMAKE_C_COMPILER_ID MATCHES "Apple[Cc]lang")
FILTER_OPTION (BLOSC2)
else ()
set (ENABLE_BLOSC2 OFF CACHE BOOL "" FORCE)
endif ()
else ()
FILTER_OPTION (BLOSC2)
endif ()
# BZIP2 filter
if (NOT MINGW)
FILTER_OPTION (BZIP2)
else ()
set (ENABLE_BZIP2 OFF CACHE BOOL "" FORCE)
endif ()
# FPZIP filter
#FILTER_OPTION (FPZIP)
# JPEG filter
if (NOT WIN32)
FILTER_OPTION (JPEG)
#elseif (NOT CMAKE_C_COMPILER_ID MATCHES "[Cc]lang" AND NOT CMAKE_C_COMPILER_ID MATCHES "[Ll][Ll][Vv][Mm]")
# FILTER_OPTION (JPEG)
else ()
set (ENABLE_JPEG OFF CACHE BOOL "" FORCE)
endif ()
# LZ4 filter
if (NOT MINGW)
if (WIN32)
if (NOT CMAKE_C_COMPILER_ID MATCHES "Intel[Ll][Ll][Vv][Mm]")
if (MSVC_VERSION GREATER_EQUAL 1930 AND NOT CMAKE_C_COMPILER_ID MATCHES "[Cc]lang")
FILTER_OPTION (LZ4)
else ()
set (ENABLE_LZ4 OFF CACHE BOOL "" FORCE)
endif ()
else ()
set (ENABLE_LZ4 OFF CACHE BOOL "" FORCE)
endif ()
else ()
FILTER_OPTION (LZ4)
#set (ENABLE_LZ4 OFF CACHE BOOL "" FORCE)
endif ()
else ()
set (ENABLE_LZ4 OFF CACHE BOOL "" FORCE)
endif ()
# LZF filter
if (NOT MINGW AND NOT H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT")
FILTER_OPTION (LZF)
else ()
set (ENABLE_LZF OFF CACHE BOOL "" FORCE)
endif ()
# ZFP filter
FILTER_OPTION (ZFP)
# ZSTD filter
if (WIN32)
FILTER_OPTION (ZSTD)
elseif (APPLE)
if (NOT CMAKE_C_COMPILER_ID MATCHES "Intel[Ll][Ll][Vv][Mm]" AND NOT CMAKE_C_COMPILER_ID MATCHES "Intel")
FILTER_OPTION (ZSTD)
else ()
set (ENABLE_ZSTD OFF CACHE BOOL "" FORCE)
endif ()
else ()
FILTER_OPTION (ZSTD)
endif ()
#-----------------------------------------------------------------------------
# Dashboard and Testing Settings
#-----------------------------------------------------------------------------
option (H5PL_BUILD_TESTING "Build h5pl Unit Testing" OFF)
if (H5PL_BUILD_TESTING)
set (DART_TESTING_TIMEOUT 1200 CACHE STRING
"Timeout in seconds for each test (default 1200=20minutes)")
enable_testing ()
include (CTest)
include (${PROJECT_SOURCE_DIR}/CTestConfig.cmake)
configure_file (${${PLUGIN_PACKAGE_NAME}_RESOURCES_DIR}/CTestCustom.cmake ${PROJECT_BINARY_DIR}/CTestCustom.ctest @ONLY)
endif ()
#-----------------------------------------------------------------------------
# Community Filters
#-----------------------------------------------------------------------------
option (H5PL_COMMUNITY "Enable building community filters" OFF)
add_subdirectory (community)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------
option (H5PL_CPACK_ENABLE "Enable the CPACK include and components" ON)
INSTALL_SUPPORT (H5PL)