From 42daa20056545c36983cb0ab8edcfdda3ebf9ebe Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Mon, 4 Nov 2019 03:33:19 -0500 Subject: [PATCH] FindFFmpeg: Expand duplicate-removal Repeated invocations (e.g. `cmake .` in an already-configured dir) might cause variables to collect duplicates. --- cmake/Modules/FindFFmpeg.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/FindFFmpeg.cmake b/cmake/Modules/FindFFmpeg.cmake index b2409e05..b6da9244 100644 --- a/cmake/Modules/FindFFmpeg.cmake +++ b/cmake/Modules/FindFFmpeg.cmake @@ -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.