find_package(PkgConfig REQUIRED)
find_package(Qt6 REQUIRED COMPONENTS Widgets Xml Network LinguistTools)

set(PLUGIN_NAME "screenshotplugin")

include_directories(${PROJECT_SOURCE_DIR}/app/src)

add_library(${PLUGIN_NAME} SHARED 
    screenshotplugin.cpp 
    screenshotplugincontainer.cpp
    screenshotpluginfactory.cpp
)
 
qt_add_translations(${PLUGIN_NAME} TS_FILES 
    ${PROJECT_SOURCE_DIR}/translations/${PLUGIN_NAME}_de.ts 
)

target_link_libraries(${PLUGIN_NAME} PRIVATE Qt6::Widgets Qt6::Xml Qt6::Network)

install(TARGETS ${PLUGIN_NAME} DESTINATION ${PLUGIN_TARGET_DIR})
install(FILES 
    ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_NAME}_de.qm
    DESTINATION ${TRANSLATION_TARGET_DIR}
)
