From 0b39e139af35ded8eedb763c47cc9a4b3d8fae14 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sun, 14 Mar 2021 23:32:00 +0100 Subject: Fix FFmpeg build error messages --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b0796060a..ea01dfab3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2306,22 +2306,22 @@ if(FFMPEG) if(NOT FFMPEG_libavcodec_FOUND) message(FATAL_ERROR "FFmpeg support requires libavcodec and its development headers.") elseif(FFMPEG_libavcodec_VERSION AND FFMPEG_libavcodec_VERSION VERSION_LESS 58) - message(FATAL_ERROR "FFmpeg support requires at least version 58 of libavcodec (found: ${AVCODEC_VERSION}).") + message(FATAL_ERROR "FFmpeg support requires at least version 58 of libavcodec (found: ${FFMPEG_libavcodec_VERSION}).") endif() if(NOT FFMPEG_libavformat_FOUND) message(FATAL_ERROR "FFmpeg support requires libavformat and its development headers.") elseif(FFMPEG_libavformat_VERSION AND FFMPEG_libavformat_VERSION VERSION_LESS 58) - message(FATAL_ERROR "FFmpeg support requires at least version 58 of libavformat (found: ${AVFORMAT_VERSION}).") + message(FATAL_ERROR "FFmpeg support requires at least version 58 of libavformat (found: ${FFMPEG_libavformat_VERSION}).") endif() if(NOT FFMPEG_libavutil_FOUND) message(FATAL_ERROR "FFmpeg support requires libavutil and its development headers.") elseif(FFMPEG_libavutil_VERSION AND FFMPEG_libavutil_VERSION VERSION_LESS 56) - message(FATAL_ERROR "FFmpeg support requires at least version 56 of libavutil (found: ${AVUTIL_VERSION}).") + message(FATAL_ERROR "FFmpeg support requires at least version 56 of libavutil (found: ${FFMPEG_libavutil_VERSION}).") endif() if(NOT FFMPEG_libswresample_FOUND) message(FATAL_ERROR "FFmpeg support requires libswresample and its development headers.") elseif(FFMPEG_libswresample_VERSION AND FFMPEG_libswresample_VERSION VERSION_LESS 3.1) - message(FATAL_ERROR "FFmpeg support requires at least version 3.1 of libswresample (found: ${SWRESAMPLE_VERSION}).") + message(FATAL_ERROR "FFmpeg support requires at least version 3.1 of libswresample (found: ${FFMPEG_libswresample_VERSION}).") endif() target_sources(mixxx-lib PRIVATE src/sources/soundsourceffmpeg.cpp) -- cgit v1.2.3 From eee2e1eaad95c06ab052600fde772f57d74df223 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sun, 14 Mar 2021 23:32:52 +0100 Subject: Allow to enable FFmpeg even if no component versions available --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ea01dfab3f..3047c3d895 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2301,7 +2301,12 @@ endif() # FFmpeg 4.x support # FFmpeg is multimedia library that can be found http://ffmpeg.org/ find_package(FFMPEG COMPONENTS libavcodec libavformat libavutil libswresample) -cmake_dependent_option(FFMPEG "FFmpeg 4.x support" ON "FFMPEG_FOUND;FFMPEG_libavcodec_VERSION VERSION_GREATER_EQUAL 58" OFF) +# On Windows version numbers are not available! +if(FFMPEG_libavcodec_VERSION) + cmake_dependent_option(FFMPEG "FFmpeg 4.x support" ON "FFMPEG_FOUND;FFMPEG_libavcodec_VERSION VERSION_GREATER_EQUAL 58" OFF) +else() + cmake_dependent_option(FFMPEG "FFmpeg 4.x support" ON "FFMPEG_FOUND" OFF) +endif() if(FFMPEG) if(NOT FFMPEG_libavcodec_FOUND) message(FATAL_ERROR "FFmpeg support requires libavcodec and its development headers.") -- cgit v1.2.3 From 9d98b7e97c7f10e14672e38621761664a4228678 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Wed, 17 Mar 2021 11:08:18 +0100 Subject: CMake: Simplify FFmpeg option --- CMakeLists.txt | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 3047c3d895..ed41591a3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2301,31 +2301,25 @@ endif() # FFmpeg 4.x support # FFmpeg is multimedia library that can be found http://ffmpeg.org/ find_package(FFMPEG COMPONENTS libavcodec libavformat libavutil libswresample) -# On Windows version numbers are not available! -if(FFMPEG_libavcodec_VERSION) - cmake_dependent_option(FFMPEG "FFmpeg 4.x support" ON "FFMPEG_FOUND;FFMPEG_libavcodec_VERSION VERSION_GREATER_EQUAL 58" OFF) -else() - cmake_dependent_option(FFMPEG "FFmpeg 4.x support" ON "FFMPEG_FOUND" OFF) -endif() +cmake_dependent_option(FFMPEG "FFmpeg 4.x support" ON "FFMPEG_FOUND" OFF) if(FFMPEG) - if(NOT FFMPEG_libavcodec_FOUND) - message(FATAL_ERROR "FFmpeg support requires libavcodec and its development headers.") - elseif(FFMPEG_libavcodec_VERSION AND FFMPEG_libavcodec_VERSION VERSION_LESS 58) + if(NOT FFMPEG_FOUND) + message(FATAL_ERROR "FFMPEG was not found") + endif() + + # Check minimum required versions + # Windows: Version numbers are not available!? + # macOS: Untested + if(FFMPEG_libavcodec_VERSION AND FFMPEG_libavcodec_VERSION VERSION_LESS 58) message(FATAL_ERROR "FFmpeg support requires at least version 58 of libavcodec (found: ${FFMPEG_libavcodec_VERSION}).") endif() - if(NOT FFMPEG_libavformat_FOUND) - message(FATAL_ERROR "FFmpeg support requires libavformat and its development headers.") - elseif(FFMPEG_libavformat_VERSION AND FFMPEG_libavformat_VERSION VERSION_LESS 58) + if(FFMPEG_libavformat_VERSION AND FFMPEG_libavformat_VERSION VERSION_LESS 58) message(FATAL_ERROR "FFmpeg support requires at least version 58 of libavformat (found: ${FFMPEG_libavformat_VERSION}).") endif() - if(NOT FFMPEG_libavutil_FOUND) - message(FATAL_ERROR "FFmpeg support requires libavutil and its development headers.") - elseif(FFMPEG_libavutil_VERSION AND FFMPEG_libavutil_VERSION VERSION_LESS 56) + if(FFMPEG_libavutil_VERSION AND FFMPEG_libavutil_VERSION VERSION_LESS 56) message(FATAL_ERROR "FFmpeg support requires at least version 56 of libavutil (found: ${FFMPEG_libavutil_VERSION}).") endif() - if(NOT FFMPEG_libswresample_FOUND) - message(FATAL_ERROR "FFmpeg support requires libswresample and its development headers.") - elseif(FFMPEG_libswresample_VERSION AND FFMPEG_libswresample_VERSION VERSION_LESS 3.1) + if(FFMPEG_libswresample_VERSION AND FFMPEG_libswresample_VERSION VERSION_LESS 3.1) message(FATAL_ERROR "FFmpeg support requires at least version 3.1 of libswresample (found: ${FFMPEG_libswresample_VERSION}).") endif() @@ -2337,7 +2331,6 @@ if(FFMPEG) __STDC_LIMIT_MACROS __STDC_FORMAT_MACROS ) - target_link_libraries(mixxx-lib PUBLIC "${FFMPEG_LIBRARIES}") target_include_directories(mixxx-lib PUBLIC "${FFMPEG_INCLUDE_DIRS}") endif() -- cgit v1.2.3 From c89f23a4b945b305cea7a3d461f58735a30ccd6a Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Wed, 17 Mar 2021 13:15:46 +0100 Subject: CMake: Restrict MEDIAFOUNDATION to Windows --- CMakeLists.txt | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ed41591a3b..b3cd649502 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2480,22 +2480,24 @@ if(MAD) endif() # Media Foundation AAC Decoder Plugin -find_package(MediaFoundation) -cmake_dependent_option(MEDIAFOUNDATION "Media Foundation AAC decoder plugin (Windows Vista with KB2117917 or Windows 7 required)" ON "MediaFoundation_FOUND" OFF) -if(MEDIAFOUNDATION) - if(NOT MediaFoundation_FOUND) - message(FATAL_ERROR "MediaFoundation support requires the MediaFoundation libraries and its development headers.") +if(WIN32) + find_package(MediaFoundation) + cmake_dependent_option(MEDIAFOUNDATION "Media Foundation AAC decoder plugin" ON "MediaFoundation_FOUND" OFF) + if(MEDIAFOUNDATION) + if(NOT MediaFoundation_FOUND) + message(FATAL_ERROR "MediaFoundation support requires the MediaFoundation libraries and its development headers.") + endif() + target_sources(mixxx-lib PRIVATE + src/sources/soundsourcemediafoundation.cpp + ) + target_compile_definitions(mixxx-lib PUBLIC __MEDIAFOUNDATION__) + target_include_directories(mixxx-lib SYSTEM PRIVATE + ${MediaFoundation_INCLUDE_DIRS} + ) + target_link_libraries(mixxx-lib PUBLIC + ${MediaFoundation_LIBRARIES} + ) endif() - target_sources(mixxx-lib PRIVATE - src/sources/soundsourcemediafoundation.cpp - ) - target_compile_definitions(mixxx-lib PUBLIC __MEDIAFOUNDATION__) - target_include_directories(mixxx-lib SYSTEM PRIVATE - ${MediaFoundation_INCLUDE_DIRS} - ) - target_link_libraries(mixxx-lib PUBLIC - ${MediaFoundation_LIBRARIES} - ) endif() # Modplug support -- cgit v1.2.3 From 058c38805147140d940845fe4fe6cdfb809dc42d Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Wed, 17 Mar 2021 13:16:17 +0100 Subject: Delete redundant cmake_dependent_option() --- CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index b3cd649502..7442de4f6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2419,11 +2419,7 @@ find_package(SQLite3) # FIXME # It is difficult to get qmake to link Qt to a custom built SQLite on macOS instead of the system SQLite, # which results in a crash on startup when LOCALECOMPARE is enabled. -if(APPLE) - cmake_dependent_option(LOCALECOMPARE "Locale Aware Compare support for SQLite" OFF "SQLite3_FOUND" OFF) -else() - cmake_dependent_option(LOCALECOMPARE "Locale Aware Compare support for SQLite" ON "SQLite3_FOUND" OFF) -endif() +cmake_dependent_option(LOCALECOMPARE "Locale Aware Compare support for SQLite" ON "SQLite3_FOUND AND NOT APPLE" OFF) if(LOCALECOMPARE) if(NOT SQLite3_FOUND) message(FATAL_ERROR "Locale Aware Compare for SQLite requires libsqlite and its development headers.") -- cgit v1.2.3 From e402aaeda14a4b5e7bff9ad3c7701c616c8db7dd Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Wed, 17 Mar 2021 13:17:00 +0100 Subject: Use cmake_dependent_option() for WavPack consistently --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 7442de4f6f..934b5930e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2622,9 +2622,9 @@ endif() # WavPack audio file support find_package(wavpack) -option(WAVPACK "WavPack audio file support" OFF) +cmake_dependent_option(BULK "WavPack audio file support" ON "wavpack_FOUND" OFF) if(WAVPACK) - if(NOT TARGET WavPack::wavpack) + if(NOT wavpack_FOUND) message(FATAL_ERROR "WavPack audio file support requires libwv and its development headers.") endif() target_sources(mixxx-lib PRIVATE src/sources/soundsourcewv.cpp) -- cgit v1.2.3