summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-01-15 15:29:30 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-01-15 15:29:36 (GMT)
commitb9b5d4928425e02230ededd0ce4361f51f280c20 (patch)
tree4f5c188c83e6d69d7e6e52da9c3e55e2d8f4023c
parent2e792b6ec29762fff89ecf517d43b281e17a0814 (diff)
parenta5fe1712b2fd4971c03e7d898c40caeba7feb4af (diff)
downloadCMake-b9b5d4928425e02230ededd0ce4361f51f280c20.zip
CMake-b9b5d4928425e02230ededd0ce4361f51f280c20.tar.gz
CMake-b9b5d4928425e02230ededd0ce4361f51f280c20.tar.bz2
Merge topic 'FindHDF5-no-dedup-keywords'
a5fe1712b2 FindHDF5: Remove unnecessary de-duplication of HDF5_LIBRARIES and friends dadb13f546 FindHDF5: Simplify preprocessor setting de-duplication Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5692
-rw-r--r--Modules/FindHDF5.cmake34
1 files changed, 6 insertions, 28 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index f64f72f..a69a585 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -213,22 +213,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
@@ -731,10 +715,8 @@ if(NOT HDF5_FOUND)
endif()
set(HDF5_${_lang}_FOUND TRUE)
- _HDF5_remove_duplicates_from_beginning(HDF5_${_lang}_DEFINITIONS)
- _HDF5_remove_duplicates_from_beginning(HDF5_${_lang}_INCLUDE_DIRS)
- _HDF5_remove_duplicates_from_beginning(HDF5_${_lang}_LIBRARIES)
- _HDF5_remove_duplicates_from_beginning(HDF5_${_lang}_HL_LIBRARIES)
+ list(REMOVE_DUPLICATES HDF5_${_lang}_DEFINITIONS)
+ list(REMOVE_DUPLICATES HDF5_${_lang}_INCLUDE_DIRS)
else()
set(_HDF5_NEED_TO_SEARCH TRUE)
endif()
@@ -787,10 +769,8 @@ elseif(NOT HDF5_FOUND AND NOT _HDF5_NEED_TO_SEARCH)
endif()
endif()
endforeach()
- _HDF5_remove_duplicates_from_beginning(HDF5_DEFINITIONS)
- _HDF5_remove_duplicates_from_beginning(HDF5_INCLUDE_DIRS)
- _HDF5_remove_duplicates_from_beginning(HDF5_LIBRARIES)
- _HDF5_remove_duplicates_from_beginning(HDF5_HL_LIBRARIES)
+ list(REMOVE_DUPLICATES HDF5_DEFINITIONS)
+ list(REMOVE_DUPLICATES HDF5_INCLUDE_DIRS)
set(HDF5_FOUND TRUE)
set(HDF5_REQUIRED_VARS HDF5_LIBRARIES)
if(HDF5_FIND_HL)
@@ -930,10 +910,8 @@ if( NOT HDF5_FOUND )
set(HDF5_HL_FOUND TRUE)
endif()
- _HDF5_remove_duplicates_from_beginning(HDF5_DEFINITIONS)
- _HDF5_remove_duplicates_from_beginning(HDF5_INCLUDE_DIRS)
- _HDF5_remove_duplicates_from_beginning(HDF5_LIBRARIES)
- _HDF5_remove_duplicates_from_beginning(HDF5_HL_LIBRARIES)
+ list(REMOVE_DUPLICATES HDF5_DEFINITIONS)
+ list(REMOVE_DUPLICATES HDF5_INCLUDE_DIRS)
# If the HDF5 include directory was found, open H5pubconf.h to determine if
# HDF5 was compiled with parallel IO support