Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,17 @@ jobs:
with:
# This should always match the minimum required version in
# our CMakeLists.txt
cmake-version: "3.21.x"
cmake-version: "3.22.x"

- name: "[Windows] Set up cmake"
uses: jwlawson/actions-setup-cmake@v2.2
# Ubuntu 24.04 should use the CMake version from the repos.
# On windows-11-arm this action installs the x64 version which has unwanted side effects
if: matrix.os == 'windows-2022'
with:
# This is a workaround for a SSL false positive in cmake 3.26.4
# When downloading the manual. 3.21 is required for installing the
# ANGLE Dlls via IMPORTED_RUNTIME_ARTIFACTS
cmake-version: "3.21.x"
# This is a workaround for a SSL false positive in cmake 3.26.4 when downloading the manual.
# 3.22 is required for Qt 6.10 https://doc.qt.io/qt-6.10/cmake-supported-cmake-versions.html
cmake-version: "3.22.x"

- name: "[Windows] Set up MSVC Developer Command Prompt"
if: runner.os == 'Windows'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ jobs:
with:
# This should always match the minimum required version in
# our CMakeLists.txt
cmake-version: "3.21.x"
cmake-version: "3.22.x"

- name: "[Windows] Set up cmake"
uses: jwlawson/actions-setup-cmake@v2.2
Expand Down
101 changes: 59 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.21)
# Qt 6.10 requires minimum CMake 3.22: https://doc.qt.io/qt-6.10/cmake-supported-cmake-versions.html
cmake_minimum_required(VERSION 3.22)
# lint_cmake: -readability/wonkycase

message(STATUS "CMAKE_VERSION: ${CMAKE_VERSION}")
Expand Down Expand Up @@ -2764,51 +2765,68 @@ endif()

# FFmpeg support
# FFmpeg is multimedia library that can be found http://ffmpeg.org/
find_package(FFMPEG COMPONENTS libavcodec libavformat libavutil libswresample)
default_option(FFMPEG "FFmpeg support (version 4.1.9 or later)" "FFMPEG_FOUND")
find_package(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWRESAMPLE)
default_option(FFMPEG "FFmpeg support (version 4.1.9 or later)" "FFmpeg_FOUND")
if(FFMPEG)
if(NOT FFMPEG_FOUND)
message(FATAL_ERROR "FFMPEG was not found")
if(NOT FFmpeg_FOUND)
message(FATAL_ERROR "FFmpeg was not found")
endif()

# Check minimum required versions
# Minimum library versions according to <https://ffmpeg.org/download.html>
# Windows: Version numbers are not available!?
# macOS: Untested
if(
FFMPEG_libavcodec_VERSION
AND FFMPEG_libavcodec_VERSION VERSION_LESS 58.35.100
NOT FFmpeg_AVCODEC_VERSION
OR FFmpeg_AVCODEC_VERSION VERSION_LESS 58.35.100
)
message(
FATAL_ERROR
"FFmpeg support requires at least version 58.35.100 of libavcodec (found: ${FFMPEG_libavcodec_VERSION})."
"FFmpeg support requires at least version 58.35.100 of libavcodec (found: ${FFmpeg_AVCODEC_VERSION})."
)
else()
message(
STATUS
"Found FFmpeg AVCODEC: ${FFmpeg_AVCODEC_LIBRARIES} (found version \"${FFmpeg_AVCODEC_VERSION}\")"
)
endif()
if(
FFMPEG_libavformat_VERSION
AND FFMPEG_libavformat_VERSION VERSION_LESS 58.20.100
NOT FFmpeg_AVFORMAT_VERSION
OR FFmpeg_AVFORMAT_VERSION VERSION_LESS 58.20.100
)
message(
FATAL_ERROR
"FFmpeg support requires at least version 58.20.100 of libavformat (found: ${FFMPEG_libavformat_VERSION})."
"FFmpeg support requires at least version 58.20.100 of libavformat (found: ${FFmpeg_AVFORMAT_VERSION})."
)
else()
message(
STATUS
"Found FFmpeg AVFORMAT: ${FFmpeg_AVFORMAT_LIBRARIES} (found version \"${FFmpeg_AVFORMAT_VERSION}\")"
)
endif()
if(
FFMPEG_libavutil_VERSION
AND FFMPEG_libavutil_VERSION VERSION_LESS 56.22.100
)
if(NOT FFmpeg_AVUTIL_VERSION OR FFmpeg_AVUTIL_VERSION VERSION_LESS 56.22.100)
message(
FATAL_ERROR
"FFmpeg support requires at least version 56.22.100 of libavutil (found: ${FFMPEG_libavutil_VERSION})."
"FFmpeg support requires at least version 56.22.100 of libavutil (found: ${FFmpeg_AVUTIL_VERSION})."
)
else()
message(
STATUS
"Found FFmpeg AVUTIL: ${FFmpeg_AVUTIL_LIBRARIES} (found version \"${FFmpeg_AVUTIL_VERSION}\")"
)
endif()
if(
FFMPEG_libswresample_VERSION
AND FFMPEG_libswresample_VERSION VERSION_LESS 3.3.100
NOT FFmpeg_SWRESAMPLE_VERSION
OR FFmpeg_SWRESAMPLE_VERSION VERSION_LESS 3.3.100
)
message(
FATAL_ERROR
"FFmpeg support requires at least version 3.3.100 of libswresample (found: ${FFMPEG_libswresample_VERSION})."
"FFmpeg support requires at least version 3.3.100 of libswresample (found: ${FFmpeg_SWRESAMPLE_VERSION})."
)
else()
message(
STATUS
"Found FFmpeg SWRESAMPLE: ${FFmpeg_SWRESAMPLE_LIBRARIES} (found version \"${FFmpeg_SWRESAMPLE_VERSION}\")"
)
endif()

Expand All @@ -2822,15 +2840,16 @@ if(FFMPEG)
__STDC_LIMIT_MACROS
__STDC_FORMAT_MACROS
)
target_link_libraries(mixxx-lib PRIVATE "${FFMPEG_LIBRARIES}")
target_include_directories(mixxx-lib PUBLIC "${FFMPEG_INCLUDE_DIRS}")

target_link_libraries(mixxx-lib PRIVATE FFmpeg::FFmpeg)
target_include_directories(mixxx-lib PUBLIC "${FFmpeg_INCLUDE_DIRS}")
endif()

# STEM file support
default_option(STEM "STEM file support" "FFMPEG_FOUND;FFMPEG")
default_option(STEM "STEM file support" "FFmpeg_FOUND;FFMPEG")
if(STEM)
if(NOT FFMPEG)
message(FATAL_ERROR "STEM requires that also FFMPEG is enabled")
message(FATAL_ERROR "STEM requires that also FFmpeg is enabled")
endif()
target_compile_definitions(mixxx-lib PUBLIC __STEM__)
list(APPEND MIXXX_LIB_PRECOMPILED_HEADER src/track/steminfo.h)
Expand Down Expand Up @@ -4415,12 +4434,12 @@ if(APPLE)
"-weak_framework CoreAudio"
"-weak_framework CoreFoundation"
"-weak_framework CoreImage"
"-weak_framework CoreMedia"
"-framework CoreMedia"
"-weak_framework CoreMidi"
"-weak_framework CoreServices"
"-weak_framework CoreVideo"
"-framework CoreVideo"
"-weak_framework IOSurface"
"-weak_framework VideoToolbox"
"-framework VideoToolbox"
)
if(IOS)
target_link_libraries(mixxx-lib PRIVATE "-weak_framework UIKit")
Expand Down Expand Up @@ -4853,31 +4872,29 @@ endif()

# FDK-AAC is loaded dynamically at runtime by EncoderFdkAac using QLibrary,
# so copy it into the Windows and macOS packages, but do not link to it.
if(APPLE AND MACOS_BUNDLE)
find_library(FDK_AAC_LIBRARY fdk-aac)
if(FDK_AAC_LIBRARY)
message(STATUS "Found fdk-aac: ${FDK_AAC_LIBRARY}")
find_package(FdkAac QUIET)
if(FdkAac_FOUND)
if(APPLE AND MACOS_BUNDLE)
message(STATUS "Found fdk-aac: ${FdkAac_LIBRARY}")
file(
COPY ${FDK_AAC_LIBRARY}
COPY "${FdkAac_LIBRARY}"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/lib/fdk-aac-install"
FOLLOW_SYMLINK_CHAIN
)
install(
DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib/fdk-aac-install/"
DESTINATION "${MIXXX_INSTALL_PREFIX}/Contents/Frameworks"
)
else()
message(STATUS "Could NOT find libfdk-aac.dylib")
endif()
elseif(WIN32)
# On Windows find_library finds the .lib file, but the installer needs the .dll file.
find_file(FDK_AAC_DLL fdk-aac.dll PATH_SUFFIXES ${CMAKE_INSTALL_BINDIR})
if(FDK_AAC_DLL)
message(STATUS "Found fdk-aac DLL: ${FDK_AAC_DLL}")
install(FILES ${FDK_AAC_DLL} DESTINATION ${MIXXX_INSTALL_BINDIR})
else()
message(STATUS "Could NOT find fdk-aac.dll")
elseif(WIN32)
if(FdkAac_DLL)
message(STATUS "Found fdk-aac DLL: ${FdkAac_DLL}")
install(FILES "${FdkAac_DLL}" DESTINATION "${MIXXX_INSTALL_BINDIR}")
else()
message(STATUS "Could NOT find fdk-aac.dll (FdkAac_DLL not set)")
endif()
endif()
else()
message(STATUS "Could NOT find fdk-aac (FdkAac_FOUND is FALSE)")
endif()

# Google PerfTools
Expand Down
Loading
Loading