代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.20)
project(SDLClient)
# 设置C++标准为17
set(CMAKE_CXX_STANDARD 20)
# FFmpeg配置
set(FFMPEG_DIR "D:/Software/ffmpeg")
set(FFMPEG_INCLUDE_DIR "${FFMPEG_DIR}/include")
set(FFMPEG_LIB_DIR "${FFMPEG_DIR}/lib")
# SDL2配置
set(SDL2_DIR "D:/Software/SDL2/x86_64-w64-mingw32")
set(SDL2_INCLUDE_DIR "${SDL2_DIR}/include")
set(SDL2_LIB_DIR "${SDL2_DIR}/lib")
# 包含目录和链接目录
include_directories(${FFMPEG_INCLUDE_DIR} ${SDL2_INCLUDE_DIR})
link_directories(${FFMPEG_LIB_DIR} ${SDL2_LIB_DIR})
# 添加可执行文件
add_executable(SDLClient demux.cpp)
# 添加新的可执行文件
add_executable(SoundPlayer soundplayer.cpp)
# 链接库
target_link_libraries(SoundPlayer
mingw32
SDL2main
SDL2
avformat
avcodec
swresample
avutil
pthread
)
# 链接库
target_link_libraries(SDLClient
mingw32
SDL2main
SDL2
avformat
avcodec
swresample
swscale
avutil
pthread
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。