-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathFindHDF5.cmake
More file actions
71 lines (59 loc) · 1.2 KB
/
FindHDF5.cmake
File metadata and controls
71 lines (59 loc) · 1.2 KB
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
# FindHDF5.cmake
#
# Finds the HDF5 data format library
#
# This will define the following variables
#
# HDF5_FOUND
# HDF5_INCLUDE_DIRS
# HDF5_LIBRARIES
#
# and the following imported targets
#
# HDF5::HDF5
#
# The following variables can be set as arguments
#
# HDF5_ROOT
#
find_package(PkgConfig QUIET)
pkg_check_modules(_HDF5_PC QUIET hdf5)
find_path(
HDF5_INCLUDE_DIRS
NAMES hdf5.h
PATHS
${_HDF5_PC_INCLUDE_DIRS}
PATH_SUFFIXES
include
)
find_library(
HDF5_LIBRARIES
NAMES hdf5
PATHS
${_HDF5_PC_LIBRARY_DIRS}
PATH_SUFFIXES
lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
HDF5
REQUIRED_VARS # The first one is displayed in the message
HDF5_LIBRARIES
HDF5_INCLUDE_DIRS
)
if(HDF5_FOUND)
if(NOT TARGET HDF5::HDF5)
add_library(HDF5::HDF5 INTERFACE IMPORTED)
set_target_properties(
HDF5::HDF5
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${HDF5_LIBRARIES}"
)
endif()
endif()
mark_as_advanced(
HDF5_ROOT
HDF5_INCLUDE_DIRS
HDF5_LIBRARIES
)