build: 统一 FFmpeg 依赖配置风格

- 重新 配置 FFmpeg 头文件和链接库
- 区分 Debug 与 Release 链接配置
- 移除额外依赖校验和 DLL 自动复制
feature/nmNum-postprocessing-view-20260910
lh 2 weeks ago
parent 5e0b17f2f0
commit 44cdd58d0c

@ -1,52 +1,22 @@
# PEBI动画导出使用的可选FFmpeg n1.1开发包。 # PEBI animation export FFmpeg n1.1 dependency.
# nmSubWxs默认启用;其他目标可通过CONFIG显式选择是否接入。 win32{
contains(CONFIG, nm_ffmpeg_video_export) {
FFMPEG_11_ROOT = $${geoHome}/3rd/FFmpeg-1.1
FFMPEG_11_VS2010_COMPAT = $${FFMPEG_11_ROOT}/compat/vs2010
FFMPEG_11_RUNTIME_DLLS = \
$${FFMPEG_11_ROOT}/bin/avformat-54.dll \
$${FFMPEG_11_ROOT}/bin/avcodec-54.dll \
$${FFMPEG_11_ROOT}/bin/avutil-52.dll \
$${FFMPEG_11_ROOT}/bin/swscale-2.dll
!exists($${FFMPEG_11_ROOT}/include/libavformat/avformat.h) { DEFINES += NM_ENABLE_FFMPEG_VIDEO_EXPORT
error(FFmpeg n1.1 headers were not found in $${FFMPEG_11_ROOT}/include)
}
!exists($${FFMPEG_11_ROOT}/include/libavcodec/avcodec.h) {
error(FFmpeg n1.1 avcodec headers were not found)
}
!exists($${FFMPEG_11_ROOT}/include/libavutil/avutil.h) {
error(FFmpeg n1.1 avutil headers were not found)
}
!exists($${FFMPEG_11_ROOT}/include/libswscale/swscale.h) {
error(FFmpeg n1.1 swscale headers were not found)
}
!exists($${FFMPEG_11_ROOT}/lib/avformat.lib) {
error(FFmpeg n1.1 avformat import library was not found)
}
!exists($${FFMPEG_11_ROOT}/lib/avcodec.lib) {
error(FFmpeg n1.1 avcodec import library was not found)
}
!exists($${FFMPEG_11_ROOT}/lib/avutil.lib) {
error(FFmpeg n1.1 avutil import library was not found)
}
!exists($${FFMPEG_11_ROOT}/lib/swscale.lib) {
error(FFmpeg n1.1 swscale import library was not found)
}
!exists($${FFMPEG_11_VS2010_COMPAT}/inttypes.h) {
error(FFmpeg n1.1 VS2010 compatibility header inttypes.h was not found)
}
DEFINES += NM_ENABLE_FFMPEG_VIDEO_EXPORT INCLUDEPATH += $${geoHome}/3rd/FFmpeg-1.1/compat/vs2010
INCLUDEPATH += $${FFMPEG_11_VS2010_COMPAT} INCLUDEPATH += $${geoHome}/3rd/FFmpeg-1.1/include
INCLUDEPATH += $${FFMPEG_11_ROOT}/include DEPENDPATH += $${geoHome}/3rd/FFmpeg-1.1/compat/vs2010
LIBS += -L$${FFMPEG_11_ROOT}/lib DEPENDPATH += $${geoHome}/3rd/FFmpeg-1.1/include
LIBS += -lavformat -lavcodec -lavutil -lswscale
for(FFMPEG_11_RUNTIME_DLL, FFMPEG_11_RUNTIME_DLLS) { Debug:LIBS += -L$${geoHome}/3rd/FFmpeg-1.1/lib \
!exists($${FFMPEG_11_RUNTIME_DLL}) { -lavformat \
error(FFmpeg runtime DLL was not found: $${FFMPEG_11_RUNTIME_DLL}) -lavcodec \
} -lavutil \
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($${FFMPEG_11_RUNTIME_DLL}) $$quote($${DESTDIR}) $$escape_expand(\\n\\t) -lswscale
}
Release:LIBS += -L$${geoHome}/3rd/FFmpeg-1.1/lib \
-lavformat \
-lavcodec \
-lavutil \
-lswscale
} }

@ -10,7 +10,6 @@ TEMPLATE = lib
include(../../setting.pri) include(../../setting.pri)
include(../../vtk.pri) include(../../vtk.pri)
CONFIG += nm_ffmpeg_video_export
include(../../ffmpeg.pri) include(../../ffmpeg.pri)
DEFINES += NM_SUB_WXS_LIBRARY DEFINES += NM_SUB_WXS_LIBRARY

Loading…
Cancel
Save