2017-02-20 18:37:11 +01:00
|
|
|
# metadata
|
|
|
|
set(META_PROJECT_NAME syncthingfileitemaction)
|
|
|
|
set(META_APP_NAME "Syncthing KIO-Plugin")
|
|
|
|
set(META_APP_DESCRIPTION "KIO file item action for Syncthing")
|
|
|
|
set(META_PROJECT_TYPE qtplugin)
|
2018-04-01 23:02:14 +02:00
|
|
|
set(META_QT5_VERSION 5.8)
|
2017-02-20 18:37:11 +01:00
|
|
|
|
|
|
|
# add project files
|
2019-11-30 18:24:19 +01:00
|
|
|
set(HEADER_FILES syncthingmenuaction.h syncthinginfoaction.h syncthingdiractions.h syncthingfileitemactionstaticdata.h
|
|
|
|
syncthingfileitemaction.h)
|
|
|
|
set(SRC_FILES syncthingmenuaction.cpp syncthinginfoaction.cpp syncthingdiractions.cpp syncthingfileitemactionstaticdata.cpp
|
|
|
|
syncthingfileitemaction.cpp)
|
2017-02-20 18:37:11 +01:00
|
|
|
|
2021-10-08 22:54:30 +02:00
|
|
|
set(TS_FILES translations/${META_PROJECT_NAME}_zh_CN.ts translations/${META_PROJECT_NAME}_cs_CZ.ts
|
|
|
|
translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
|
2017-02-26 18:59:37 +01:00
|
|
|
|
2017-02-20 18:37:11 +01:00
|
|
|
# find c++utilities
|
2022-10-13 19:35:30 +02:00
|
|
|
find_package(${PACKAGE_NAMESPACE_PREFIX}c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.20.0 REQUIRED)
|
2017-02-20 18:37:11 +01:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CPP_UTILITIES_MODULE_DIRS})
|
|
|
|
|
|
|
|
# find qtutilities
|
2022-07-16 20:30:18 +02:00
|
|
|
find_package(${PACKAGE_NAMESPACE_PREFIX}qtutilities${CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES} 6.7.0 REQUIRED)
|
2017-02-20 18:37:11 +01:00
|
|
|
use_qt_utilities()
|
|
|
|
|
|
|
|
# find backend libraries
|
|
|
|
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
|
|
|
|
use_syncthingconnector()
|
|
|
|
find_package(syncthingmodel ${META_APP_VERSION} REQUIRED)
|
|
|
|
use_syncthingmodel()
|
|
|
|
|
2021-07-03 19:29:49 +02:00
|
|
|
# link also explicitly against the following Qt and KF modules
|
2017-02-20 18:37:11 +01:00
|
|
|
list(APPEND ADDITIONAL_QT_MODULES Network)
|
|
|
|
list(APPEND ADDITIONAL_KF_MODULES KIO)
|
2023-02-07 20:57:21 +01:00
|
|
|
set(KF_PACKAGE_PREFIX
|
|
|
|
"KF5"
|
|
|
|
CACHE STRING "specifies the prefix for KDE Frameworks packages")
|
|
|
|
set(KIO_MODULE_TARGETS "${KF_PACKAGE_PREFIX}::KIOCore" "${KF_PACKAGE_PREFIX}::KIOFileWidgets"
|
|
|
|
"${KF_PACKAGE_PREFIX}::KIOWidgets")
|
|
|
|
if (KF_PACKAGE_PREFIX MATCHES ".*KF([0-9]+).*")
|
|
|
|
set(KF_VERSION ${CMAKE_MATCH_1})
|
|
|
|
if (KF_VERSION GREATER_EQUAL 6)
|
|
|
|
list(APPEND KIO_MODULE_TARGETS)
|
|
|
|
else ()
|
|
|
|
list(APPEND KIO_MODULE_TARGETS "${KF_PACKAGE_PREFIX}::KIONTLM")
|
|
|
|
endif ()
|
|
|
|
endif ()
|
2017-02-20 18:37:11 +01:00
|
|
|
|
|
|
|
# include modules to apply configuration
|
|
|
|
include(BasicConfig)
|
|
|
|
include(QtGuiConfig)
|
|
|
|
include(QtConfig)
|
|
|
|
include(WindowsResources)
|
|
|
|
include(LibraryTarget)
|
|
|
|
include(ConfigHeader)
|
2022-10-13 19:35:30 +02:00
|
|
|
include(AppUtilities)
|
2017-02-25 18:55:42 +01:00
|
|
|
|
2020-02-14 23:04:10 +01:00
|
|
|
# configure and install desktop file
|
|
|
|
include(TemplateFinder)
|
|
|
|
find_template_file("${META_PROJECT_NAME}.desktop" "${META_PROJECT_NAME}" DESKTOP_TEMPLATE_FILE)
|
|
|
|
set(DESKTOP_TARGET_FILE "${CMAKE_CURRENT_BINARY_DIR}/${META_TARGET_NAME}.desktop")
|
|
|
|
configure_file("${DESKTOP_TEMPLATE_FILE}" "${DESKTOP_TARGET_FILE}")
|
2020-02-18 20:46:57 +01:00
|
|
|
install(
|
|
|
|
FILES "${DESKTOP_TARGET_FILE}"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/kservices5"
|
|
|
|
COMPONENT desktop)
|
2022-10-13 19:35:30 +02:00
|
|
|
|
|
|
|
# install appstream file
|
|
|
|
add_appstream_file()
|