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

set(PLUGIN_NAME "filenameplugin")

pkg_check_modules(LIBEPT libept)

include_directories(${PROJECT_SOURCE_DIR}/app/src)

add_library(${PLUGIN_NAME} SHARED 
filenameplugin.cpp 
           filenameplugincontainer.cpp 
           filenamepluginfactory.cpp 
           filenameview.cpp 
           filenamesearchinput.cpp 
           filenamefeedbackwidget.cpp 
           filenameactionplugin.cpp 
           filenamefeedbackwidget.ui 
           filenamesearchinput.ui 
           filenameview.ui
)
 
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)

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