From f30b0fec749710e7eec68ddd148215609a5c01f9 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 23 Jun 2016 10:56:29 -0400 Subject: FindHDF5: correctly add lang to each component target name. --- Modules/FindHDF5.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index bc0d50b..cc05f1c 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -362,7 +362,7 @@ 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) + get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION) if( _lang_location ) set(HDF5_${_lang}_LIBRARY ${_lang_location} CACHE PATH "HDF5 ${_lang} library" ) -- cgit v0.12 From 149539d9c2d90da76facbd70c969b82af8e2448a Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 23 Jun 2016 10:57:58 -0400 Subject: FindHDF5: Handle HDF5 builds with non-suffixed components --- Modules/FindHDF5.cmake | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v0.12 From 9f2728cef3763dff93a43b933a10f32eb73f7c6b Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 23 Jun 2016 12:31:26 -0400 Subject: FindHDF5: When component targets not found fallback to compiler wrappers --- Modules/FindHDF5.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 53c0085..7c1581d 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -366,6 +366,12 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT) #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() -- cgit v0.12 From 963b576fd2605f25ced8790fc17f5baa6ecee761 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 24 Jun 2016 15:26:22 -0400 Subject: FindHDF5: cache the correct path to the high level libraries --- Modules/FindHDF5.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 7c1581d..ce3b6d0 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -384,10 +384,10 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT) 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}) endif() endif() -- cgit v0.12 From 234deec2ea265f130a220547bcbc697bacbb25c6 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Fri, 24 Jun 2016 15:28:23 -0400 Subject: FindHDF5: create all the *_LIBRARIES when using hdf5-config.cmake --- Modules/FindHDF5.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index ce3b6d0..b074f63 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -381,6 +381,7 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT) "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) @@ -389,6 +390,7 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT) "HDF5 ${_lang} HL 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() @@ -424,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) -- cgit v0.12