-
Notifications
You must be signed in to change notification settings - Fork 19
/
h5cpp-config.cmake.in
54 lines (43 loc) · 1.5 KB
/
h5cpp-config.cmake.in
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
include(CMakeFindDependencyMacro)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
if(CMAKE_VERSION VERSION_LESS 3.19)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/hdf5")
endif()
#
# add some additional information via cached variables
#
set(H5CPP_MPI_ENABLED @H5CPP_WITH_MPI@ CACHE BOOL "h5cpp was built with MPI support")
set(H5CPP_SWMR_ENABLED @H5CPP_WITH_SWMR@ CACHE BOOL "h5cpp was built with SMWR support")
set(H5CPP_VDS_ENABLED @H5CPP_WITH_VDS@ CACHE BOOL "h5cpp was built with VDS support")
set(H5CPP_BOOST_ENABLED @H5CPP_WITH_BOOST@ CACHE BOOL "h5cpp was built against boost")
#
# checking for the Boost library
#
if(H5CPP_BOOST_ENABLED)
set(BOOST_COMPONENTS)
if(NOT TARGET Boost::filesystem)
list(APPEND BOOST_COMPONENTS filesystem)
endif()
if(NOT TARGET Boost::system)
list(APPEND BOOST_COMPONENTS system)
endif()
find_dependency(Boost ${BOOST_VERSION} ${BOOST_EXACT} COMPONENTS ${BOOST_COMPONENTS})
if(NOT Boost_FOUND)
message(FATAL_ERROR "Could not find Boost filesystem library - cannot load h5cpp targets")
endif()
endif()
find_dependency(Threads)
find_package(SZIP) # optional dependency so use find_package
find_dependency(ZLIB)
#
# checking for hdf5
#
set(HDF5_PREFER_PARALLEL @H5CPP_WITH_MPI@)
find_dependency(HDF5 @HDF5_VERSION@ EXACT COMPONENTS C HL)
if(H5CPP_MPI_ENABLED AND (NOT HDF5_IS_PARALLEL))
message(FATAL_ERROR "HDF5 library with MPI support required!")
endif()
#
# load targets
#
include(${CMAKE_CURRENT_LIST_DIR}/h5cpp_targets.cmake)