summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-28 13:06:37 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-06-28 13:06:37 (GMT)
commitf23d846a971b99ec23bee1ff2afaee845a846e5f (patch)
treeb25e89e5e2e5ee38909b170ebc8fe319e03b6801 /Modules
parent1b021a64f8bf4d9544acb18628e3821f61f49e10 (diff)
parent234deec2ea265f130a220547bcbc697bacbb25c6 (diff)
downloadCMake-f23d846a971b99ec23bee1ff2afaee845a846e5f.zip
CMake-f23d846a971b99ec23bee1ff2afaee845a846e5f.tar.gz
CMake-f23d846a971b99ec23bee1ff2afaee845a846e5f.tar.bz2
Merge topic 'FindHDF5-handle-unsuffixed'
234deec2 FindHDF5: create all the *_LIBRARIES when using hdf5-config.cmake 963b576f FindHDF5: cache the correct path to the high level libraries 9f2728ce FindHDF5: When component targets not found fallback to compiler wrappers 149539d9 FindHDF5: Handle HDF5 builds with non-suffixed components f30b0fec FindHDF5: correctly add lang to each component target name.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindHDF5.cmake25
1 files changed, 21 insertions, 4 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index bc0d50b..b074f63 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -362,20 +362,35 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
set(_suffix "-shared")
endif()
foreach(_lang ${HDF5_LANGUAGE_BINDINGS})
- get_target_property(_lang_location ${HDF5_${_component}_TARGET}${_suffix} LOCATION)
+
+ #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})
+ if(NOT TARGET ${HDF5_${_lang}_TARGET})
+ #cant find this component with our without the suffix
+ #so bail out, and let the following locate HDF5
+ set(HDF5_FOUND FALSE)
+ break()
+ endif()
+ set(_suffix "")
+ endif()
+
+ get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION)
if( _lang_location )
set(HDF5_${_lang}_LIBRARY ${_lang_location} CACHE PATH
"HDF5 ${_lang} library" )
mark_as_advanced(HDF5_${_lang}_LIBRARY)
list(APPEND HDF5_LIBRARIES ${HDF5_${_lang}_LIBRARY})
+ set(HDF5_${_lang}_LIBRARIES ${HDF5_${_lang}_LIBRARY})
endif()
if(FIND_HL)
get_target_property(_lang_hl_location ${HDF5_${_lang}_HL_TARGET}${_suffix} LOCATION)
- if( _lang_location )
- set(HDF5_${_lang}_HL_LIBRARY ${_lang_location} CACHE PATH
+ if( _lang_hl_location )
+ set(HDF5_${_lang}_HL_LIBRARY ${_lang_hl_location} CACHE PATH
"HDF5 ${_lang} HL library" )
- mark_as_advanced(HDF5_${_lang}_LIBRARY)
+ mark_as_advanced(HDF5_${_lang}_HL_LIBRARY)
list(APPEND HDF5_HL_LIBRARIES ${HDF5_${_lang}_HL_LIBRARY})
+ set(HDF5_${_lang}_HL_LIBRARIES ${HDF5_${_lang}_HL_LIBRARY})
endif()
endif()
endforeach()
@@ -411,6 +426,8 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
set(HDF5_${__lang}_DEFINITIONS)
set(HDF5_${__lang}_INCLUDE_DIRS)
set(HDF5_${__lang}_LIBRARIES)
+ set(HDF5_${__lang}_HL_LIBRARIES)
+
mark_as_advanced(HDF5_${__lang}_COMPILER_EXECUTABLE_NO_INTERROGATE)
mark_as_advanced(HDF5_${__lang}_DEFINITIONS)
mark_as_advanced(HDF5_${__lang}_INCLUDE_DIRS)