File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -94,9 +94,15 @@ macro(manage_components)
94
94
# If the component is found.
95
95
if (${COMPONENT} _FOUND )
96
96
message (STATUS "Component ${COMPONENT} present." )
97
- set (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${COMPONENT}_LIBRARIES} )
98
- set (FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${COMPONENT}_DEFINITIONS} )
99
- list (APPEND FFMPEG_INCLUDE_DIR ${${COMPONENT}_INCLUDE_DIR} )
97
+ # Skip components which are in a different location
98
+ # This prevents us to depend on libav system libraries if we build with ffmpeg (and the reverse).
99
+ if (NOT FFMPEG_INCLUDE_DIR OR FFMPEG_INCLUDE_DIR STREQUAL ${${COMPONENT}_INCLUDE_DIR} )
100
+ set (FFMPEG_INCLUDE_DIR ${${COMPONENT}_INCLUDE_DIR} )
101
+ set (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${COMPONENT}_LIBRARIES} )
102
+ set (FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${COMPONENT}_DEFINITIONS} )
103
+ else ()
104
+ set (${COMPONENT} _FOUND FALSE )
105
+ endif ()
100
106
else ()
101
107
if (FFmpeg_FIND_REQUIRED )
102
108
message (SEND_ERROR "Error: required component ${COMPONENT} missing." )
Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ include(AvTranscoderMacros)
6
6
find_package (FFmpeg COMPONENTS avcodec avformat avutil swscale swresample avresample )
7
7
8
8
# Check if FFmpeg or libav dependency
9
- if (avresample_FOUND )
10
- add_definitions (-DAVTRANSCODER_LIBAV_DEPENDENCY )
11
- message ("Build avTranscoder with dependency to libav." )
12
- elseif (swresample_FOUND )
9
+ if (swresample_FOUND )
13
10
add_definitions (-DAVTRANSCODER_FFMPEG_DEPENDENCY )
14
11
message ("Build avTranscoder with dependency to ffmpeg." )
12
+ elseif (avresample_FOUND )
13
+ add_definitions (-DAVTRANSCODER_LIBAV_DEPENDENCY )
14
+ message ("Build avTranscoder with dependency to libav." )
15
15
else ()
16
16
message (SEND_ERROR "Can't define if you depend on ffmpeg or libav." )
17
17
endif ()
You can’t perform that action at this time.
0 commit comments