summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/cmake/FindHDF5.cmake60
-rw-r--r--config/cmake/hdf5-config.cmake.build.in5
-rw-r--r--config/cmake/hdf5-config.cmake.install.in5
3 files changed, 54 insertions, 16 deletions
diff --git a/config/cmake/FindHDF5.cmake b/config/cmake/FindHDF5.cmake
index 4e448ca..3c3f6d6 100644
--- a/config/cmake/FindHDF5.cmake
+++ b/config/cmake/FindHDF5.cmake
@@ -15,11 +15,12 @@
# HDF5_VERSION_MINOR - minor part (e.g. 5)
#
# The following boolean vars will be defined
-# HDF5_ENABLE_PARALLEL - 1 if HDF5 parallel supported
-# HDF5_BUILD_FORTRAN - 1 if HDF5 was compiled with fortran on
-# HDF5_BUILD_CPP_LIB - 1 if HDF5 was compiled with cpp on
-# HDF5_BUILD_TOOLS - 1 if HDF5 was compiled with tools on
-# HDF5_BUILD_HL_LIB - 1 if HDF5 was compiled with parallel on
+# HDF5_ENABLE_PARALLEL - 1 if HDF5 parallel supported
+# HDF5_BUILD_FORTRAN - 1 if HDF5 was compiled with fortran on
+# HDF5_BUILD_CPP_LIB - 1 if HDF5 was compiled with cpp on
+# HDF5_BUILD_TOOLS - 1 if HDF5 was compiled with tools on
+# HDF5_BUILD_HL_LIB - 1 if HDF5 was compiled with high level on
+# HDF5_BUILD_HL_CPP_LIB - 1 if HDF5 was compiled with high level and cpp on
#
# Target names that are valid (depending on enabled options)
# will be the following
@@ -35,22 +36,49 @@
# hdf5_hl_cpp : High Level cpp interface library
#
# To aid in finding HDF5 as part of a subproject set
-# HDF5_ROOT_DIR_HINT to the location where HDF5-config.cmake lies
+# HDF5_ROOT_DIR_HINT to the location where hdf5-config.cmake lies
-FIND_PATH (HDF5_ROOT_DIR "HDF5-config.cmake"
- ${HDF5_ROOT_DIR_HINT}
- /usr/local/lib
- /usr/local/lib64
- /usr/lib
- /usr/lib64
- "C:/Program Files/HDF5/lib"
+INCLUDE (SelectLibraryConfigurations)
+INCLUDE (FindPackageHandleStandardArgs)
+
+# The HINTS option should only be used for values computed from the system.
+SET (_HDF5_HINTS
+ $ENV{HOME}/.local
+ $ENV{HDF5_ROOT}
+ $ENV{HDF5_ROOT_DIR_HINT}
+)
+# Hard-coded guesses should still go in PATHS. This ensures that the user
+# environment can always override hard guesses.
+SET (_HDF5_PATHS
+ $ENV{HOME}/.local
+ $ENV{HDF5_ROOT}
+ $ENV{HDF5_ROOT_DIR_HINT}
+ /usr/lib/hdf5
+ /usr/share/hdf5
+ /usr/local/hdf5
+ /usr/local/hdf5/share
)
-FIND_PATH (HDF5_INCLUDE_DIR "H5public.h"
- ${HDF5_ROOT_DIR}/../include
+FIND_PATH (HDF5_ROOT_DIR "hdf5-config.cmake"
+ HINTS ${_HDF5_HINTS}
+ PATHS ${_HDF5_PATHS}
+ PATH_SUFFIXES
+ lib/cmake/hdf5-1.8.6
)
+FIND_PATH (HDF5_INCLUDE_DIRS "H5public.h"
+ HINTS ${_HDF5_HINTS}
+ PATHS ${_HDF5_PATHS}
+ PATH_SUFFIXES
+ include
+ Include
+)
+
+# For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
+# HDF5_INCLUDE_DIRS
+SET ( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
+
IF (HDF5_INCLUDE_DIR)
SET (HDF5_FOUND "YES")
- INCLUDE (${HDF5_ROOT_DIR}/HDF5-config.cmake)
+ INCLUDE (${HDF5_ROOT_DIR}/hdf5-config.cmake)
ENDIF (HDF5_INCLUDE_DIR)
diff --git a/config/cmake/hdf5-config.cmake.build.in b/config/cmake/hdf5-config.cmake.build.in
index 32bab7c..9c8aec3 100644
--- a/config/cmake/hdf5-config.cmake.build.in
+++ b/config/cmake/hdf5-config.cmake.build.in
@@ -11,6 +11,7 @@ SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
+SET (HDF5_BUILD_HL_CPP_LIB @HDF5_BUILD_HL_CPP_LIB@)
#-----------------------------------------------------------------------------
# Directories
@@ -29,6 +30,10 @@ IF (HDF5_BUILD_HL_LIB)
SET (HDF5_INCLUDE_DIR_HL ${HDF5_INCLUDE_DIR} )
ENDIF (HDF5_BUILD_HL_LIB)
+IF (HDF5_BUILD_HL_CPP_LIB)
+ SET (HDF5_INCLUDE_DIR_HL_CPP ${HDF5_INCLUDE_DIR} )
+ENDIF (HDF5_BUILD_HL_CPP_LIB)
+
IF (HDF5_BUILD_TOOLS)
SET (HDF5_INCLUDE_DIR_TOOLS ${HDF5_INCLUDE_DIR} )
ENDIF (HDF5_BUILD_TOOLS)
diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in
index ba5ba9a..8a1bffb 100644
--- a/config/cmake/hdf5-config.cmake.install.in
+++ b/config/cmake/hdf5-config.cmake.install.in
@@ -11,6 +11,7 @@ SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@)
SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@)
SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@)
SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@)
+SET (HDF5_BUILD_HL_CPP_LIB @HDF5_BUILD_HL_CPP_LIB@)
#-----------------------------------------------------------------------------
# Directories
@@ -25,6 +26,10 @@ IF (HDF5_BUILD_CPP_LIB)
SET (HDF5_INCLUDE_DIR_CPP "@CMAKE_INSTALL_PREFIX@/include/cpp" )
ENDIF (HDF5_BUILD_CPP_LIB)
+IF (HDF5_BUILD_HL_CPP_LIB)
+ SET (HDF5_INCLUDE_DIR_HL_CPP "@CMAKE_INSTALL_PREFIX@/include/hl/cpp" )
+ENDIF (HDF5_BUILD_HL_CPP_LIB)
+
IF (HDF5_BUILD_HL_LIB)
SET (HDF5_INCLUDE_DIR_HL "@CMAKE_INSTALL_PREFIX@/include/hl" )
ENDIF (HDF5_BUILD_HL_LIB)