From 166ee6b48325f361a4dbef6bbc048ad5984cf7df Mon Sep 17 00:00:00 2001 From: cc9cii Date: Mon, 15 Sep 2014 18:49:07 +1000 Subject: [PATCH] Do not use cached FFMPEG_LIBRARIES. Make error messages clearer. --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df134f9c0..df2c2fdf8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,6 +140,7 @@ set(OPENMW_LIBS_HEADER) # Sound setup set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE AVRESAMPLE) +unset(FFMPEG_LIBRARIES CACHE) find_package(FFmpeg) if ( NOT AVCODEC_FOUND OR NOT AVFORMAT_FOUND OR NOT AVUTIL_FOUND OR NOT SWSCALE_FOUND ) message(FATAL_ERROR "FFmpeg component required, but not found!") @@ -150,10 +151,15 @@ if( SWRESAMPLE_FOUND ) add_definitions(-DHAVE_LIBSWRESAMPLE) set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES} ${SWRESAMPLE_LIBRARIES}) else() - if( AVRESAMPLE_FOUND) - set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES} ${AVRESAMPLE_LIBRARIES}) + # restrict the use of libavresample to debian based system only + if(EXISTS "/etc/debian_version") + if( AVRESAMPLE_FOUND ) + set(SOUND_INPUT_LIBRARY ${FFMPEG_LIBRARIES} ${AVRESAMPLE_LIBRARIES}) + else() + message(FATAL_ERROR "Libav libavresample required, but not found!") + endif() else() - message(FATAL_ERROR "FFmpeg component required, but not found!") + message(FATAL_ERROR "FFmpeg libswresample required, but not found!") endif() endif()