cmake_minimum_required(VERSION 3.10) project(WindowsSenderDemo) set(CMAKE_CXX_STANDARD 17) # Windows specific if(WIN32) add_definitions(-DUNICODE -D_UNICODE -DWIN32_LEAN_AND_MEAN -DNOMINMAX) endif() # Source files set(SOURCES main.cpp ScreenCapture.cpp ScreenCapture.h VideoEncoder.cpp VideoEncoder.h NetworkSender.cpp NetworkSender.h ) add_executable(WindowsSenderDemo ${SOURCES}) # Libraries # Media Foundation libraries are removed as we switch to FFmpeg # target_link_libraries(WindowsSenderDemo d3d11 dxgi mf mfplat mfuuid ws2_32 mfreadwrite) # Find FFmpeg # You might need to set FFMPEG_ROOT to your FFmpeg installation path # e.g. cmake .. -DFFMPEG_ROOT="C:/ffmpeg" find_path(AVCODEC_INCLUDE_DIR libavcodec/avcodec.h PATHS ${FFMPEG_ROOT}/include) find_library(AVCODEC_LIBRARY avcodec PATHS ${FFMPEG_ROOT}/lib) find_library(AVFORMAT_LIBRARY avformat PATHS ${FFMPEG_ROOT}/lib) find_library(AVUTIL_LIBRARY avutil PATHS ${FFMPEG_ROOT}/lib) find_library(SWSCALE_LIBRARY swscale PATHS ${FFMPEG_ROOT}/lib) if (AVCODEC_INCLUDE_DIR AND AVCODEC_LIBRARY) include_directories(${AVCODEC_INCLUDE_DIR}) message(STATUS "Found FFmpeg: ${AVCODEC_INCLUDE_DIR}") else() message(FATAL_ERROR "FFmpeg not found! Please set FFMPEG_ROOT to your FFmpeg installation.") endif() target_link_libraries(WindowsSenderDemo d3d11 dxgi ws2_32 ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY} ${SWSCALE_LIBRARY} )