cmake_minimum_required(VERSION 3.16)
project(screenshot-gallery VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Sql)

set(PROJECT_SOURCES
    src/main.cpp
    src/mainwindow.cpp
    src/mainwindow.h
    src/imagegallery.cpp
    src/imagegallery.h
    src/databasemanager.cpp
    src/databasemanager.h
)

add_executable(screenshot-gallery ${PROJECT_SOURCES})

target_link_libraries(screenshot-gallery PRIVATE
    Qt6::Core
    Qt6::Gui
    Qt6::Widgets
    Qt6::Sql
)

install(TARGETS screenshot-gallery
    BUNDLE DESTINATION .
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
