Browse Source

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.
Ben Boeckel 4 years ago
parent
commit
f56963cf05
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Modules/FindHDF5.cmake

+ 2 - 0
Modules/FindHDF5.cmake

@@ -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)