From cf0d8f1fd6ad5d4bc85d7788af459238df494260 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 3 Feb 2017 10:57:10 -0500 Subject: FindHDF5: Restore HDF5_INCLUDE_DIR in all code paths This compatibility variable should be set no matter which method was used to find HDF5. Even if `HDF5_INCLUDE_DIRS` was set by copying the `HDF5_INCLUDE_DIR` value from `hdf5-config.cmake` it will not hurt to copy the same value back. Issue: #16566 --- Modules/FindHDF5.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index b10e313..e1199a7 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -796,17 +796,18 @@ if( NOT HDF5_FOUND ) "HDF5 library compiled with parallel IO support" ) mark_as_advanced( HDF5_IS_PARALLEL ) - # For backwards compatibility we set HDF5_INCLUDE_DIR to the value of - # HDF5_INCLUDE_DIRS - if( HDF5_INCLUDE_DIRS ) - set( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" ) - endif() set(HDF5_REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS) if(FIND_HL) list(APPEND HDF5_REQUIRED_VARS HDF5_HL_LIBRARIES) endif() endif() +# For backwards compatibility we set HDF5_INCLUDE_DIR to the value of +# HDF5_INCLUDE_DIRS +if( HDF5_INCLUDE_DIRS ) + set( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" ) +endif() + # If HDF5_REQUIRED_VARS is empty at this point, then it's likely that # something external is trying to explicitly pass already found # locations -- cgit v0.12