1
1
cmake_minimum_required (VERSION 3.18)
2
- project (SZ3 VERSION 3.1.7 )
2
+ project (SZ3 VERSION 3.1.8 )
3
3
include (GNUInstallDirs)
4
4
include (CTest)
5
5
6
6
option (BUILD_SHARED_LIBS "build shared libraries by default" ON )
7
7
set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
8
8
if (MSVC )
9
- set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
10
- endif ()
9
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj" )
10
+ endif ()
11
11
set (default_build_type "Release" )
12
- if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
13
- message (STATUS "No build type was set. Setting build type to ${default_build_type} ." )
14
- set (CMAKE_BUILD_TYPE ${default_build_type} CACHE
15
- STRING "Choose the type to build" FORCE)
16
- set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
17
- "MinSizeRel" "RelWithDebInfo" )
18
- endif ()
12
+ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
13
+ message (STATUS "No build type was set. Setting build type to ${default_build_type} ." )
14
+ set (CMAKE_BUILD_TYPE ${default_build_type} CACHE
15
+ STRING "Choose the type to build" FORCE)
16
+ set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
17
+ "MinSizeRel" "RelWithDebInfo" )
18
+ endif ()
19
19
20
20
find_package (PkgConfig)
21
- find_package (OpenMP)
21
+
22
22
23
23
configure_file (${CMAKE_CURRENT_SOURCE_DIR} /include /SZ3/version .hpp.in ${CMAKE_CURRENT_BINARY_DIR} /include /SZ3/version .hpp)
24
24
@@ -28,80 +28,83 @@ target_include_directories(
28
28
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include >
29
29
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} /include >
30
30
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >
31
- )
31
+ )
32
32
target_compile_features (${PROJECT_NAME}
33
- INTERFACE cxx_std_17
34
- )
33
+ INTERFACE cxx_std_17
34
+ )
35
35
36
- target_link_libraries (${PROJECT_NAME} INTERFACE OpenMP::OpenMP_CXX)
36
+ find_package (OpenMP)
37
+ if (OpenMP_FOUND)
38
+ target_link_libraries (${PROJECT_NAME} INTERFACE OpenMP::OpenMP_CXX)
39
+ endif ()
37
40
38
41
if (MSVC )
39
42
option (SZ3_USE_BUNDLED_ZSTD "prefer the bundled version of Zstd" ON )
40
- else ()
43
+ else ()
41
44
option (SZ3_USE_BUNDLED_ZSTD "prefer the bundled version of Zstd" OFF )
42
- endif ()
43
- option (SZ3_DEBUG_TIMINGS "print debug timing information" ON )
45
+ endif ()
44
46
45
- if (SZ3_DEBUG_TIMINGS)
46
- target_compile_definitions (${PROJECT_NAME} INTERFACE SZ3_DEBUG_TIMINGS=1)
47
- else ()
48
- target_compile_definitions (${PROJECT_NAME} INTERFACE SZ3_DEBUG_TIMINGS=0)
49
- endif ()
47
+ option (SZ3_DEBUG_TIMINGS "print debug timing information" OFF )
48
+ if (SZ3_DEBUG_TIMINGS)
49
+ target_compile_definitions (${PROJECT_NAME} INTERFACE SZ3_DEBUG_TIMINGS=1)
50
+ else ()
51
+ target_compile_definitions (${PROJECT_NAME} INTERFACE SZ3_DEBUG_TIMINGS=0)
52
+ endif ()
50
53
51
54
pkg_search_module(ZSTD IMPORTED_TARGET libzstd)
52
- if (ZSTD_FOUND AND NOT SZ3_USE_BUNDLED_ZSTD)
53
- target_link_libraries (${PROJECT_NAME} INTERFACE PkgConfig::ZSTD)
54
- else ()
55
- add_subdirectory (tools/zstd)
56
- target_link_libraries (${PROJECT_NAME} INTERFACE zstd)
57
- endif ()
55
+ if (ZSTD_FOUND AND NOT SZ3_USE_BUNDLED_ZSTD)
56
+ target_link_libraries (${PROJECT_NAME} INTERFACE PkgConfig::ZSTD)
57
+ else ()
58
+ add_subdirectory (tools/zstd)
59
+ target_link_libraries (${PROJECT_NAME} INTERFACE zstd)
60
+ endif ()
58
61
59
62
find_package (GSL)
60
63
if (GSL_FOUND)
61
- target_compile_definitions (${PROJECT_NAME} INTERFACE -DENABLE_GSL="TRUE" )
62
- target_link_libraries (${PROJECT_NAME} INTERFACE GSL::gsl)
63
- endif ()
64
+ target_compile_definitions (${PROJECT_NAME} INTERFACE -DENABLE_GSL="TRUE" )
65
+ target_link_libraries (${PROJECT_NAME} INTERFACE GSL::gsl)
66
+ endif ()
64
67
65
68
add_subdirectory (tools/sz3)
66
69
add_subdirectory (tools/sz3c)
67
70
68
71
69
72
option (BUILD_H5Z_FILTER "build the H5Z-SZ3 filter" OFF )
70
- if (BUILD_H5Z_FILTER)
71
- add_subdirectory (tools/H5Z-SZ3)
72
- endif ()
73
+ if (BUILD_H5Z_FILTER)
74
+ add_subdirectory (tools/H5Z-SZ3)
75
+ endif ()
73
76
74
77
option (BUILD_MDZ "build MDZ (MMD-SZ)" OFF )
75
- if (BUILD_MDZ)
76
- add_subdirectory (tools/mdz)
77
- endif ()
78
+ if (BUILD_MDZ)
79
+ add_subdirectory (tools/mdz)
80
+ endif ()
78
81
79
82
80
- install (TARGETS ${PROJECT_NAME}
81
- EXPORT SZ3Targets
82
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
83
- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
84
- )
83
+ install (TARGETS ${PROJECT_NAME}
84
+ EXPORT SZ3Targets
85
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
86
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
87
+ )
85
88
install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} /include / DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
86
89
install (FILES
87
- "${CMAKE_CURRENT_BINARY_DIR} /include/SZ3/version.hpp"
88
- DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} /SZ3/"
89
- )
90
+ "${CMAKE_CURRENT_BINARY_DIR} /include/SZ3/version.hpp"
91
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} /SZ3/"
92
+ )
90
93
install (EXPORT SZ3Targets NAMESPACE SZ3:: DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/SZ3)
91
94
include (CMakePackageConfigHelpers)
92
95
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR} /SZ3Config.cmake.in
93
- "${CMAKE_CURRENT_BINARY_DIR} /SZ3Config.cmake"
94
- INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/SZ3
95
- )
96
+ "${CMAKE_CURRENT_BINARY_DIR} /SZ3Config.cmake"
97
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/SZ3
98
+ )
96
99
write_basic_package_version_file(
97
- "${CMAKE_CURRENT_BINARY_DIR} /SZ3ConfigVersion.cmake"
98
- VERSION ${PROJECT_VERSION}
99
- COMPATIBILITY AnyNewerVersion
100
- )
100
+ "${CMAKE_CURRENT_BINARY_DIR} /SZ3ConfigVersion.cmake"
101
+ VERSION ${PROJECT_VERSION}
102
+ COMPATIBILITY AnyNewerVersion
103
+ )
101
104
install (FILES
102
- ${CMAKE_CURRENT_BINARY_DIR} /SZ3Config.cmake
103
- ${CMAKE_CURRENT_BINARY_DIR} /SZ3ConfigVersion.cmake
104
- DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/SZ3
105
- )
105
+ ${CMAKE_CURRENT_BINARY_DIR} /SZ3Config.cmake
106
+ ${CMAKE_CURRENT_BINARY_DIR} /SZ3ConfigVersion.cmake
107
+ DESTINATION ${CMAKE_INSTALL_LIBDIR} /cmake/SZ3
108
+ )
106
109
#export sz3 target for external use
107
110
export (TARGETS SZ3 FILE SZ3.cmake)
0 commit comments