summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorArtem Dyomin <artem.dyomin@qt.io>2024-03-05 13:23:39 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-05 19:53:50 +0000
commit4a32395910d08238a51c041cb31de73874ada1b4 (patch)
tree1b593eadca3cfc6bc3ab0ec92ca4a5b966ec7c2d /cmake
parentae3190d9fbd33f166f92443de5755c69c707fd3f (diff)
Relax rule of finding shared ffmpeg
The main reason for the refactoring: - we've got a problem on CI with integrating QT_DEPLOY_FFMPEG=TRUE and shared ffmpeg on macOS arm. Now it's not possible to integrate both together at the same time. Even though the problem is only with arm, it makes sense to keep the behavior the same on other platforms. After the patch developers and CI will be able to compile the FFmpeg plugin with static FFmpeg and QT_DEPLOY_FFMPEG=TRUE, and get a warning message in this case while running cmake. Pick-to: 6.6 6.5 Change-Id: I1fccc9e3a8360190f1e393a0c4805068bca47c5f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d535e4ba3d8308f3b40d3f8297760c2ef36a2f04) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindFFmpeg.cmake19
1 files changed, 12 insertions, 7 deletions
diff --git a/cmake/FindFFmpeg.cmake b/cmake/FindFFmpeg.cmake
index e112ae45e..27b49a2a5 100644
--- a/cmake/FindFFmpeg.cmake
+++ b/cmake/FindFFmpeg.cmake
@@ -70,7 +70,7 @@ if (NOT FFmpeg_FIND_COMPONENTS)
endif ()
if (QT_DEPLOY_FFMPEG AND BUILD_SHARED_LIBS)
- set(shared_libs_required TRUE)
+ set(shared_libs_desired TRUE)
endif()
# finds FFmpeg libs, including symlinks, for the specified component.
@@ -103,8 +103,7 @@ endmacro()
# Marks the given component as found if both *_LIBRARY_NAME AND *_INCLUDE_DIRS is present.
#
macro(set_component_found _component)
- if (${_component}_LIBRARY_NAME AND ${_component}_INCLUDE_DIR AND
- (${_component}_SHARED_LIBRARIES OR NOT shared_libs_required))
+ if (${_component}_LIBRARY_NAME AND ${_component}_INCLUDE_DIR)
# message(STATUS " - ${_component} found.")
set(${_component}_FOUND TRUE)
set(${CMAKE_FIND_PACKAGE_NAME}_${_component}_FOUND TRUE)
@@ -159,8 +158,8 @@ macro(find_component _component _pkgconfig _library _header)
ffmpeg include
)
- if (shared_libs_required AND NOT WIN32)
- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
+ if (shared_libs_desired AND NOT WIN32)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_SHARED_LIBRARY_SUFFIX};${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
if (${_component}_LIBRARY AND NOT EXISTS ${${_component}_LIBRARY})
@@ -345,14 +344,20 @@ endfunction()
list(LENGTH FFMPEG_LIBRARY_DIRS DIRS_COUNT)
if (${DIRS_COUNT} GREATER 1)
- message(WARNING "One FFmpeg library dir is expected, found dirs: ${FFMPEG_LIBRARY_DIRS}")
+ message(WARNING "One ffmpeg library dir is expected, found dirs: ${FFMPEG_LIBRARY_DIRS}")
endif()
if(FFMPEG_SHARED_COMPONENTS AND FFMPEG_STATIC_COMPONENTS)
message(WARNING
"Only static or shared components are expected\n"
" static components: ${FFMPEG_STATIC_COMPONENTS}\n"
- " static components: ${FFMPEG_SHARED_COMPONENTS}")
+ " shared components: ${FFMPEG_SHARED_COMPONENTS}")
+endif()
+
+if (shared_libs_desired AND NOT FFMPEG_SHARED_COMPONENTS)
+ message(WARNING
+ "Shared FFmpeg libs are desired as QT_DEPLOY_FFMPEG=TRUE, but haven't been found!\n"
+ "Remove QT_DEPLOY_FFMPEG or set the proper path to shared FFmpeg via FFMPEG_DIR.")
endif()
if (NOT TARGET FFmpeg::FFmpeg)