From 564aedf13037356bd5a4e0036c766df7df076cbb Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Tue, 29 Sep 2015 18:22:47 +0200 Subject: [PATCH] CMake: fix double dependencies of av/sw resample Fix #189 --- cmake/FindFFmpeg.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/FindFFmpeg.cmake b/cmake/FindFFmpeg.cmake index a567f67e..67e23811 100644 --- a/cmake/FindFFmpeg.cmake +++ b/cmake/FindFFmpeg.cmake @@ -94,9 +94,13 @@ macro(manage_components) # If the component is found. if(${COMPONENT}_FOUND) message(STATUS "Component ${COMPONENT} present.") - set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${COMPONENT}_LIBRARIES}) - set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${COMPONENT}_DEFINITIONS}) - list(APPEND FFMPEG_INCLUDE_DIR ${${COMPONENT}_INCLUDE_DIR}) + # Skip components which are in a different location + # This prevents us to depend on libav system libraries if we build with ffmpeg (and the reverse). + if(NOT FFMPEG_INCLUDE_DIR OR FFMPEG_INCLUDE_DIR STREQUAL ${${COMPONENT}_INCLUDE_DIR}) + set(FFMPEG_INCLUDE_DIR ${${COMPONENT}_INCLUDE_DIR}) + set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${COMPONENT}_LIBRARIES}) + set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${COMPONENT}_DEFINITIONS}) + endif() else() if(FFmpeg_FIND_REQUIRED) message(SEND_ERROR "Error: required component ${COMPONENT} missing.")