Skip to content

Commit

Permalink
FindFFmpeg: Expand duplicate-removal
Browse files Browse the repository at this point in the history
Repeated invocations (e.g. `cmake .` in an already-configured dir) might 
cause variables to collect duplicates.
  • Loading branch information
ferdnyc committed Nov 4, 2019
1 parent dad3cad commit 42daa20
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmake/Modules/FindFFmpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 42daa20

Please sign in to comment.