

qt_add_executable(VideoClient
    WIN32 MACOSX_BUNDLE
    main.cpp
    mainwindow.cpp
    mainwindow.h
    mainwindow.ui
    global.h global.cpp
    communicationsettingdlg.h communicationsettingdlg.cpp communicationsettingdlg.ui
    commandwidget.h commandwidget.cpp commandwidget.ui
    videoControl.h videoControl.ui videoControl.cpp


)

qt6_add_resources(VideoClient "resources"
    PREFIX "/"
    FILES "resources/res.qrc"
)


set(3RDPARTY_DIR ${CMAKE_CURRENT_LIST_DIR}/3rdparty)
set(FFMPEG_DIR ${3RDPARTY_DIR}/ffmpeg)

# add_subdirectory(shared)
add_subdirectory(video)
add_subdirectory(3rdparty)


target_link_libraries(VideoClient
    PRIVATE
        Qt::Core
        Qt::Gui
        Qt::Widgets
        Qt6::OpenGLWidgets
        Qt6::Network
        Qt6::SerialPort
        video
        # QWindowKit::Widgets
        # WidgetFrame
)
# 指定头文件路径
target_include_directories(VideoClient PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/)



include(GNUInstallDirs)

install(TARGETS VideoClient
    BUNDLE  DESTINATION .
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

qt_generate_deploy_app_script(
    TARGET VideoClient
    OUTPUT_SCRIPT deploy_script
    NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
