FFmpegPlayer/CMakeLists.txt
2024-01-18 22:22:26 +08:00

65 lines
1.8 KiB
CMake

cmake_minimum_required(VERSION 3.27)
project(FFmpegPlayer)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(Projects_ROOT E:/Projects)
set(Libraries_ROOT ${Projects_ROOT}/Libraries)
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_84_0_msvc2022_64bit)
set(Boost_INCLUDE_DIR ${BOOST_ROOT}/include/boost-1_84)
option(Boost_USE_STATIC_LIBS OFF)
add_compile_definitions(
BOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN10
)
find_package(Boost REQUIRED COMPONENTS json)
set(OpenSSL_ROOT D:/Qt/Tools/OpenSSLv3/Win_x64)
set(OPENSSL_INCLUDE_DIR ${OpenSSL_ROOT}/include)
set(OpenSSL_LIBRARY_DIRS ${OpenSSL_ROOT}/lib)
set(OpenSSL_LIBRARIES libssl libcrypto)
set(FFMPEG_ROOT ${Libraries_ROOT}/ffmpeg-6.0-full_build-shared)
set(FFMPEG_INCLUDE_DIR ${FFMPEG_ROOT}/include)
set(FFMPEG_LIBRARY_DIRS ${FFMPEG_ROOT}/lib)
set(FFMPEG_LIBRARIES avcodec avformat avutil)
find_package(Qt6 REQUIRED COMPONENTS Widgets)
qt_standard_project_setup()
set(LibDataChannel_DIR E:/Projects/Libraries/libdatachannel-0.19.5_msvc2022_64bit_debug/lib/cmake/LibDataChannel)
find_package(LibDataChannel)
add_subdirectory(E:/Projects/Kylin/Universal Universal)
add_subdirectory(E:/Projects/Kylin/HttpProxy HttpProxy)
add_executable(FFmpegPlayer main.cpp
Demuxer.h Demuxer.cpp
AudioDecoder.h AudioDecoder.cpp
VideoDecoder.h VideoDecoder.cpp
WebRTCPublisher.h WebRTCPublisher.cpp
)
target_include_directories(FFmpegPlayer
PRIVATE ${FFMPEG_INCLUDE_DIR}
)
target_link_directories(FFmpegPlayer
PRIVATE ${FFMPEG_LIBRARY_DIRS}
PRIVATE ${OpenSSL_LIBRARY_DIRS}
)
target_link_libraries(FFmpegPlayer
PRIVATE Qt6::Widgets
PRIVATE Universal
PRIVATE HttpProxy
PRIVATE ${FFMPEG_LIBRARIES}
PRIVATE ${OpenSSL_LIBRARIES}
PRIVATE LibDataChannel::LibDataChannel
)