FindHDF5: clear library output variables at the top of the module

This avoids accumulation of `HDF5_LIBRARIES` results when calling
`find_package(HDF5)` multiple times within a single scope.
This commit is contained in:
Ben Boeckel
2021-11-03 13:05:18 -04:00
parent f06f74ede7
commit f56963cf05

View File

@@ -161,6 +161,8 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
# scope somewhere else. We can't rely on it because different components may
# have been requested for this call.
set(HDF5_FOUND OFF)
set(HDF5_LIBRARIES)
set(HDF5_HL_LIBRARIES)
# List of the valid HDF5 components
set(HDF5_VALID_LANGUAGE_BINDINGS C CXX Fortran)