FindFFmpeg: Expand duplicate-removal

Repeated invocations (e.g. `cmake .` in an already-configured dir) might 
cause variables to collect duplicates.
This commit is contained in:
FeRD (Frank Dana)
2019-11-04 03:33:19 -05:00
parent dad3cad621
commit 42daa20056

View File

@@ -180,9 +180,16 @@ foreach (_component ${FFmpeg_FIND_COMPONENTS})
endif ()
endforeach ()
# Build the include path with duplicates removed.
# Build the result lists with duplicates removed, in case of repeated
# invocations.
if (FFmpeg_INCLUDE_DIRS)
list(REMOVE_DUPLICATES FFmpeg_INCLUDE_DIRS)
endif()
if (FFmpeg_LIBRARIES)
list(REMOVE_DUPLICATES FFmpeg_LIBRARIES)
endif()
if(FFmpeg_DEFINITIONS)
list(REMOVE_DUPLICATES FFmpeg_DEFINITIONS)
endif ()
# cache the vars.