summaryrefslogtreecommitdiffstats
path: root/Modules/FindHDF5.cmake
diff options
context:
space:
mode:
authorKris Thielemans <k.thielemans@ucl.ac.uk>2021-01-11 23:12:06 (GMT)
committerBrad King <brad.king@kitware.com>2021-01-12 21:26:59 (GMT)
commita5fe1712b2fd4971c03e7d898c40caeba7feb4af (patch)
tree011eef93a98df138357ceedee391e86d1c31a6de /Modules/FindHDF5.cmake
parentdadb13f546e149025e26edf8321a12e434482ffb (diff)
downloadCMake-a5fe1712b2fd4971c03e7d898c40caeba7feb4af.zip
CMake-a5fe1712b2fd4971c03e7d898c40caeba7feb4af.tar.gz
CMake-a5fe1712b2fd4971c03e7d898c40caeba7feb4af.tar.bz2
FindHDF5: Remove unnecessary de-duplication of HDF5_LIBRARIES and friends
* When both debug and optimized libraries are found, the corresponding keywords were getting de-duplicated and breaking. * CMake's link line generation de-duplicates in many cases anyway. * Other find modules do not explicitly de-duplicate in general. Fixes: #21670
Diffstat (limited to 'Modules/FindHDF5.cmake')
-rw-r--r--Modules/FindHDF5.cmake22
1 files changed, 0 insertions, 22 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index d363900..02d6b2f 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -206,22 +206,6 @@ else()
set(HDF5_Fortran_COMPILER_NAMES h5fc h5pfc)
endif()
-# We may have picked up some duplicates in various lists during the above
-# process for the language bindings (both the C and C++ bindings depend on
-# libz for example). Remove the duplicates. It appears that the default
-# CMake behavior is to remove duplicates from the end of a list. However,
-# for link lines, this is incorrect since unresolved symbols are searched
-# for down the link line. Therefore, we reverse the list, remove the
-# duplicates, and then reverse it again to get the duplicates removed from
-# the beginning.
-macro(_HDF5_remove_duplicates_from_beginning _list_name)
- if(${_list_name})
- list(REVERSE ${_list_name})
- list(REMOVE_DUPLICATES ${_list_name})
- list(REVERSE ${_list_name})
- endif()
-endmacro()
-
# Test first if the current compilers automatically wrap HDF5
function(_HDF5_test_regular_compiler_C success version is_parallel)
set(scratch_directory
@@ -726,8 +710,6 @@ if(NOT HDF5_FOUND)
set(HDF5_${_lang}_FOUND TRUE)
list(REMOVE_DUPLICATES HDF5_${_lang}_DEFINITIONS)
list(REMOVE_DUPLICATES HDF5_${_lang}_INCLUDE_DIRS)
- _HDF5_remove_duplicates_from_beginning(HDF5_${_lang}_LIBRARIES)
- _HDF5_remove_duplicates_from_beginning(HDF5_${_lang}_HL_LIBRARIES)
else()
set(_HDF5_NEED_TO_SEARCH TRUE)
endif()
@@ -782,8 +764,6 @@ elseif(NOT HDF5_FOUND AND NOT _HDF5_NEED_TO_SEARCH)
endforeach()
list(REMOVE_DUPLICATES HDF5_DEFINITIONS)
list(REMOVE_DUPLICATES HDF5_INCLUDE_DIRS)
- _HDF5_remove_duplicates_from_beginning(HDF5_LIBRARIES)
- _HDF5_remove_duplicates_from_beginning(HDF5_HL_LIBRARIES)
set(HDF5_FOUND TRUE)
set(HDF5_REQUIRED_VARS HDF5_LIBRARIES)
if(HDF5_FIND_HL)
@@ -925,8 +905,6 @@ if( NOT HDF5_FOUND )
list(REMOVE_DUPLICATES HDF5_DEFINITIONS)
list(REMOVE_DUPLICATES HDF5_INCLUDE_DIRS)
- _HDF5_remove_duplicates_from_beginning(HDF5_LIBRARIES)
- _HDF5_remove_duplicates_from_beginning(HDF5_HL_LIBRARIES)
# If the HDF5 include directory was found, open H5pubconf.h to determine if
# HDF5 was compiled with parallel IO support