cmake_minimum_required(VERSION 3.16)
project(youtube-playlist LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

find_package(Qt6 REQUIRED COMPONENTS Gui Qml Quick Multimedia Svg QuickEffects)

set(CMAKE_AUTOMOC ON)

qt_standard_project_setup()

file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/lib/*.hpp")

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/lib")

qt_add_executable(appyoutube-playlist
    ${SOURCES}
    ${HEADERS}
)

qt_add_qml_module(appyoutube-playlist
    URI App
    VERSION 1.0
    QML_FILES 
      ui/main.qml
      ui/FadingFeedback.qml
    RESOURCES
      ui/icons/pause.svg
      ui/icons/play.svg
)

target_link_libraries(appyoutube-playlist
    PRIVATE
        Qt6::Gui
        Qt6::Qml
        Qt6::Quick
        Qt6::Multimedia
        Qt6::Svg
        Qt6::QuickEffects
)
