Skip to content

Commit 5a806fa

Browse files
committed
cmake: simplify test
find_package already test for swresample/avresample, so just use the output variables.
1 parent 6e687c2 commit 5a806fa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ find_package(FFmpeg
77
COMPONENTS avcodec avformat avutil swscale swresample avresample)
88

99
# Check if FFmpeg or libav dependency
10-
if(EXISTS "${FFMPEG_INCLUDE_DIR}/libavresample/avresample.h")
10+
if(avresample_VERSION)
1111
add_definitions(-DAV_RESAMPLE_LIBRARY)
12-
else()
12+
elseif(swresample_VERSION)
1313
add_definitions(-DFF_RESAMPLE_LIBRARY)
14+
else()
15+
message(SEND_ERROR, "Need 'swresample' or 'avresample'.")
1416
endif()
1517

1618
# Include AvTranscoder and FFmpeg

0 commit comments

Comments
 (0)