FindHDF5: Simplify preprocessor setting de-duplication

Use `list(REMOVE_DUPLICATES)` directly.  For definitions the order
doesn't matter.  For include directories it is better to remove late
duplicates than early duplicates.
This commit is contained in:
Brad King 2021-01-12 16:20:26 -05:00
parent 06dfa5a7b6
commit dadb13f546

View File

@ -724,8 +724,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)
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()
@ -780,8 +780,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)
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)
@ -923,8 +923,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)
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)