2016-09-30 23:55:25 +02:00
|
|
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
|
|
|
|
|
|
|
# metadata
|
|
|
|
set(META_PROJECT_TYPE application)
|
2016-10-02 21:59:28 +02:00
|
|
|
set(META_APP_NAME "Syncthing Tray")
|
2016-10-18 22:07:07 +02:00
|
|
|
set(META_APP_ACTIONS OPEN_WEBUI)
|
|
|
|
set(META_APP_ACTION_OPEN_WEBUI "open-webui" "Open web UI" "--webui")
|
2016-09-30 23:55:25 +02:00
|
|
|
|
|
|
|
# add project files
|
|
|
|
set(WIDGETS_HEADER_FILES
|
|
|
|
application/singleinstance.h
|
|
|
|
gui/trayicon.h
|
|
|
|
gui/traywidget.h
|
|
|
|
gui/traymenu.h
|
|
|
|
gui/dirbuttonsitemdelegate.h
|
|
|
|
gui/devbuttonsitemdelegate.h
|
|
|
|
gui/downloaditemdelegate.h
|
|
|
|
gui/dirview.h
|
|
|
|
gui/devview.h
|
2020-01-23 20:07:11 +01:00
|
|
|
gui/downloadview.h
|
|
|
|
gui/helper.h)
|
2016-09-30 23:55:25 +02:00
|
|
|
set(WIDGETS_SRC_FILES
|
|
|
|
application/main.cpp
|
|
|
|
application/singleinstance.cpp
|
|
|
|
gui/trayicon.cpp
|
|
|
|
gui/traywidget.cpp
|
|
|
|
gui/traymenu.cpp
|
|
|
|
gui/dirbuttonsitemdelegate.cpp
|
|
|
|
gui/devbuttonsitemdelegate.cpp
|
|
|
|
gui/downloaditemdelegate.cpp
|
|
|
|
gui/dirview.cpp
|
|
|
|
gui/devview.cpp
|
2020-01-23 20:07:11 +01:00
|
|
|
gui/downloadview.cpp
|
|
|
|
gui/helper.cpp)
|
2019-02-06 17:36:14 +01:00
|
|
|
set(RES_FILES resources/${META_PROJECT_NAME}icons.qrc)
|
|
|
|
set(WIDGETS_UI_FILES gui/traywidget.ui)
|
2016-09-30 23:55:25 +02:00
|
|
|
|
2021-10-07 18:28:13 +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)
|
2016-09-30 23:55:25 +02:00
|
|
|
|
2020-08-11 23:18:56 +02:00
|
|
|
set(ICON_FILES resources/icons/hicolor/scalable/apps/${META_PROJECT_NAME}.svg)
|
2016-09-30 23:55:25 +02:00
|
|
|
|
2019-02-06 17:36:14 +01:00
|
|
|
set(DOC_FILES README.md)
|
2016-09-30 23:55:25 +02:00
|
|
|
|
2021-08-03 14:06:17 +02:00
|
|
|
# declare required icons; used when bundling icon themes (Icons required by libraries the tray application depends on need to
|
|
|
|
# be specified as well.)
|
2016-09-30 23:55:25 +02:00
|
|
|
set(REQUIRED_ICONS
|
2020-07-12 21:50:34 +02:00
|
|
|
color-profile
|
2016-09-30 23:55:25 +02:00
|
|
|
dialog-cancel
|
|
|
|
dialog-ok
|
|
|
|
dialog-ok-apply
|
2020-04-03 16:31:41 +02:00
|
|
|
document-open
|
2016-09-30 23:55:25 +02:00
|
|
|
edit-copy
|
2019-08-08 22:55:49 +02:00
|
|
|
edit-clear
|
2019-07-07 12:23:25 +02:00
|
|
|
edit-cut
|
|
|
|
edit-delete
|
2016-09-30 23:55:25 +02:00
|
|
|
edit-paste
|
2019-07-07 12:23:25 +02:00
|
|
|
edit-redo
|
|
|
|
edit-undo
|
2020-07-12 21:50:34 +02:00
|
|
|
emblem-checked
|
2017-09-05 00:24:52 +02:00
|
|
|
emblem-error
|
2020-07-12 21:50:34 +02:00
|
|
|
emblem-remove
|
2016-09-30 23:55:25 +02:00
|
|
|
folder
|
|
|
|
folder-download
|
|
|
|
folder-open
|
|
|
|
folder-sync
|
2017-10-07 22:24:19 +02:00
|
|
|
go-down
|
|
|
|
go-up
|
2016-09-30 23:55:25 +02:00
|
|
|
help-about
|
2022-08-06 21:08:55 +02:00
|
|
|
help-contents
|
2016-09-30 23:55:25 +02:00
|
|
|
internet-web-browser
|
|
|
|
list-add
|
|
|
|
list-remove
|
|
|
|
media-playback-pause
|
|
|
|
media-playback-start
|
|
|
|
network-connect
|
2016-12-11 17:58:58 +01:00
|
|
|
network-disconnect
|
2016-09-30 23:55:25 +02:00
|
|
|
network-server
|
|
|
|
preferences-desktop
|
|
|
|
preferences-desktop-icons
|
|
|
|
preferences-desktop-locale
|
|
|
|
preferences-desktop-notification
|
2021-05-07 00:05:18 +02:00
|
|
|
preferences-system-startup
|
|
|
|
preferences-system-startup
|
|
|
|
preferences-system-services
|
2016-09-30 23:55:25 +02:00
|
|
|
preferences-other
|
2020-07-12 21:50:34 +02:00
|
|
|
process-stop
|
2016-09-30 23:55:25 +02:00
|
|
|
qtcreator
|
|
|
|
system-run
|
|
|
|
system-search
|
|
|
|
system-file-manager
|
2022-03-20 17:01:48 +01:00
|
|
|
text-x-generic
|
2022-08-25 21:35:22 +02:00
|
|
|
tools-wizard
|
2016-09-30 23:55:25 +02:00
|
|
|
view-refresh
|
2019-02-06 17:36:14 +01:00
|
|
|
window-close)
|
2016-09-30 23:55:25 +02:00
|
|
|
|
|
|
|
# find c++utilities
|
2022-08-06 19:14:18 +02:00
|
|
|
find_package(${PACKAGE_NAMESPACE_PREFIX}c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.19.0 REQUIRED)
|
2016-09-30 23:55:25 +02:00
|
|
|
use_cpp_utilities()
|
|
|
|
|
|
|
|
# find qtutilities
|
2022-07-16 19:28:31 +02:00
|
|
|
find_package(${PACKAGE_NAMESPACE_PREFIX}qtutilities${CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES} 6.7.0 REQUIRED)
|
2016-09-30 23:55:25 +02: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()
|
2017-04-23 18:27:31 +02:00
|
|
|
find_package(syncthingwidgets ${META_APP_VERSION} REQUIRED)
|
|
|
|
use_syncthingwidgets()
|
2016-09-30 23:55:25 +02:00
|
|
|
|
2021-10-06 17:19:15 +02:00
|
|
|
# link against the qtforkawesomeiconengine plugin when it is a static library
|
2021-09-15 20:36:34 +02:00
|
|
|
include(3rdParty)
|
2021-10-07 18:28:13 +02:00
|
|
|
find_package(${PACKAGE_NAMESPACE_PREFIX}qtforkawesomeiconengine${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME} 0.0.1 REQUIRED)
|
2021-10-06 17:19:15 +02:00
|
|
|
if (NOT QT_FORK_AWESOME_ICON_ENGINE_LIB_IS_SHARED)
|
2021-09-15 20:36:34 +02:00
|
|
|
use_qt_fork_awesome_icon_engine()
|
|
|
|
endif ()
|
|
|
|
|
2021-07-03 19:29:49 +02:00
|
|
|
# link also explicitly against the following Qt modules
|
2017-02-20 18:03:20 +01:00
|
|
|
list(APPEND ADDITIONAL_QT_MODULES Network)
|
2016-09-30 23:55:25 +02:00
|
|
|
|
2022-06-26 02:25:23 +02:00
|
|
|
# configure libsyncthing
|
|
|
|
option(USE_LIBSYNCTHING "whether libsyncthing should be included for syncthingtray's CLI" OFF)
|
|
|
|
if (USE_LIBSYNCTHING)
|
|
|
|
find_package(syncthing ${META_APP_VERSION} REQUIRED)
|
|
|
|
use_syncthing()
|
|
|
|
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS SYNCTHINGTRAY_USE_LIBSYNCTHING)
|
|
|
|
endif ()
|
|
|
|
|
2019-07-17 19:07:58 +02:00
|
|
|
# apply basic configuration
|
2016-09-30 23:55:25 +02:00
|
|
|
include(BasicConfig)
|
2019-07-17 19:07:58 +02:00
|
|
|
|
|
|
|
# add an option to unify left- and right-click context menus useful on Mac OS
|
|
|
|
if (APPLE)
|
|
|
|
set(UNIFY_TRAY_MENUS_BY_DEFAULT ON)
|
|
|
|
else ()
|
|
|
|
set(UNIFY_TRAY_MENUS_BY_DEFAULT OFF)
|
|
|
|
endif ()
|
|
|
|
option(UNIFY_TRAY_MENUS "unifies the left- and right-click tray menus" ${UNIFY_TRAY_MENUS_BY_DEFAULT})
|
|
|
|
if (UNIFY_TRAY_MENUS)
|
|
|
|
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_UNIFY_TRAY_MENUS)
|
|
|
|
message(STATUS "left- and right-click context menus will be unified")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
# include modules to apply configuration
|
2016-09-30 23:55:25 +02:00
|
|
|
include(QtGuiConfig)
|
|
|
|
include(QtConfig)
|
|
|
|
include(WindowsResources)
|
|
|
|
include(AppTarget)
|
|
|
|
include(ShellCompletion)
|
|
|
|
include(Doxygen)
|
|
|
|
include(ConfigHeader)
|
|
|
|
|
|
|
|
# create desktop file using previously defined meta data
|
|
|
|
add_desktop_file()
|
2019-07-18 04:58:37 +02:00
|
|
|
|
|
|
|
if (APPLE)
|
2019-11-30 18:24:19 +01:00
|
|
|
set_target_properties(${META_TARGET_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/resources/Info.plist.in")
|
2019-07-18 04:58:37 +02:00
|
|
|
endif ()
|