summaryrefslogtreecommitdiff
path: root/Modules/FindHDF5.cmake
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2021-11-03 13:05:18 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2021-11-03 13:05:18 -0400
commitf56963cf054832995488287af7b8c4abd6c8e4dd (patch)
tree48855c28def531c3671b947ab1c68c39848fdda2 /Modules/FindHDF5.cmake
parentf06f74ede7a8dc5321079b2a960479a756629727 (diff)
downloadcmake-f56963cf054832995488287af7b8c4abd6c8e4dd.tar.gz
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.
Diffstat (limited to 'Modules/FindHDF5.cmake')
-rw-r--r--Modules/FindHDF5.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index e33535513a..ce08728b23 100644
--- a/Modules/FindHDF5.cmake
+++ b/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)