summaryrefslogtreecommitdiffstats
path: root/Modules/FindHDF5.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2016-06-23 14:57:58 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2016-06-23 14:57:58 (GMT)
commit149539d9c2d90da76facbd70c969b82af8e2448a (patch)
treefac59eb5991de6b9507b1e72f2e905fc1a25ee47 /Modules/FindHDF5.cmake
parentf30b0fec749710e7eec68ddd148215609a5c01f9 (diff)
downloadCMake-149539d9c2d90da76facbd70c969b82af8e2448a.zip
CMake-149539d9c2d90da76facbd70c969b82af8e2448a.tar.gz
CMake-149539d9c2d90da76facbd70c969b82af8e2448a.tar.bz2
FindHDF5: Handle HDF5 builds with non-suffixed components
Diffstat (limited to 'Modules/FindHDF5.cmake')
-rw-r--r--Modules/FindHDF5.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index cc05f1c..53c0085 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -362,6 +362,13 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
set(_suffix "-shared")
endif()
foreach(_lang ${HDF5_LANGUAGE_BINDINGS})
+
+ #Older versions of hdf5 don't have a static/shared suffix so
+ #if we detect that occurrence clear the suffix
+ if(_suffix AND NOT TARGET ${HDF5_${_lang}_TARGET}${_suffix})
+ set(_suffix "")
+ endif()
+
get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION)
if( _lang_location )
set(HDF5_${_lang}_LIBRARY ${_lang_location} CACHE PATH