syncthingtray/syncthingwidgets/CMakeLists.txt

157 lines
4.9 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.17.0 FATAL_ERROR)
# metadata
set(META_PROJECT_NAME syncthingwidgets)
set(META_PROJECT_TYPE library)
set(META_APP_NAME "Widgets of Syncthing Tray")
set(META_PUBLIC_QT_MODULES Gui Widgets)
set(META_WEBVIEW_SRC_DIR webview)
# add project files
set(WIDGETS_HEADER_FILES
settings/settings.h
settings/settingsdialog.h
settings/wizard.h
settings/wizardenums.h
webview/webpage.h
webview/webviewdialog.h
misc/textviewdialog.h
misc/internalerrorsdialog.h
misc/direrrorsdialog.h
misc/statusinfo.h
misc/dbusstatusnotifier.h
misc/internalerror.h
misc/otherdialogs.h
misc/syncthinglauncher.h
2019-02-06 17:36:14 +01:00
misc/syncthingkiller.h)
set(WIDGETS_SRC_FILES
settings/settings.cpp
settings/settingsdialog.cpp
settings/setupdetection.h
settings/setupdetection.cpp
settings/wizard.cpp
webview/webpage.cpp
webview/webviewdialog.cpp
webview/webviewinterceptor.h
webview/webviewinterceptor.cpp
misc/textviewdialog.cpp
misc/internalerrorsdialog.cpp
misc/direrrorsdialog.cpp
misc/statusinfo.cpp
misc/dbusstatusnotifier.cpp
misc/internalerror.cpp
misc/otherdialogs.cpp
misc/syncthinglauncher.cpp
2019-02-06 17:36:14 +01:00
misc/syncthingkiller.cpp)
set(RES_FILES resources/${META_PROJECT_NAME}icons.qrc)
set(WIDGETS_UI_FILES
settings/connectionoptionpage.ui
settings/notificationsoptionpage.ui
settings/appearanceoptionpage.ui
2019-05-19 17:56:11 +02:00
settings/iconsoptionpage.ui
settings/autostartoptionpage.ui
settings/launcheroptionpage.ui
settings/systemdoptionpage.ui
settings/generalwebviewoptionpage.ui
settings/builtinwebviewoptionpage.ui
2022-09-03 21:32:44 +02:00
settings/mainconfigwizardpage.ui
settings/autostartwizardpage.ui
settings/applywizardpage.ui)
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)
set(REQUIRED_ICONS
color-profile
2020-04-03 16:31:41 +02:00
document-open
preferences-other
process-stop
list-add
preferences-desktop
internet-web-browser
system-run
edit-paste
list-remove
preferences-desktop-notification
2021-05-07 00:05:18 +02:00
preferences-system-startup
preferences-system-services
view-refresh
emblem-checked
network-connect
emblem-remove
2017-10-07 22:24:19 +02:00
go-down
go-up
2022-10-30 21:40:42 +01:00
quickwizard
help-contents)
2022-10-16 15:08:29 +02:00
set(QT_TESTS wizard)
# find c++utilities
find_package(${PACKAGE_NAMESPACE_PREFIX}c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.20.0 REQUIRED)
use_cpp_utilities(VISIBILITY PUBLIC)
# find qtutilities
find_package(${PACKAGE_NAMESPACE_PREFIX}qtutilities${CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES} 6.13.0 REQUIRED)
use_qt_utilities()
# find backend libraries
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
2019-03-13 19:12:23 +01:00
use_syncthingconnector(VISIBILITY PUBLIC)
find_package(syncthingmodel ${META_APP_VERSION} REQUIRED)
2019-03-13 19:12:23 +01:00
use_syncthingmodel(VISIBILITY PUBLIC)
find_package(syncthingtesthelper ${META_APP_VERSION} REQUIRED)
list(APPEND PRIVATE_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/../testhelper/include")
# configure libsyncthing
option(USE_LIBSYNCTHING "whether libsyncthing should be included for the launcher" OFF)
2019-02-06 17:36:14 +01:00
if (USE_LIBSYNCTHING)
find_package(syncthing ${META_APP_VERSION} REQUIRED)
use_syncthing(VISIBILITY PUBLIC)
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS SYNCTHINGWIDGETS_USE_LIBSYNCTHING)
2019-02-06 17:36:14 +01:00
endif ()
# configure autostart .desktop file exec path
set(AUTOSTART_EXEC_PATH
""
CACHE STRING "Set the Exec= path for Linux' autostart/syncthingtray.desktop file - useful for Nix & Guix")
if (AUTOSTART_EXEC_PATH)
set_property(
SOURCE settings/settingsdialog.cpp
APPEND
PROPERTY COMPILE_DEFINITIONS SYNCTHINGWIDGETS_AUTOSTART_EXEC_PATH="${AUTOSTART_EXEC_PATH}")
endif ()
# link also explicitly against the following Qt modules
list(APPEND ADDITIONAL_QT_MODULES Network Concurrent)
# include modules to apply configuration
include(BasicConfig)
include(QtGuiConfig)
2019-03-13 19:12:23 +01:00
include(QtWebViewProviderConfig)
include(QtConfig)
include(WindowsResources)
include(LibraryTarget)
include(Doxygen)
include(ConfigHeader)
2022-10-16 15:08:29 +02:00
# configure test target
include(TestUtilities)
list(APPEND QT_TEST_LIBRARIES ${CPP_UTILITIES_LIB} ${META_TARGET_NAME})
use_qt_module(LIBRARIES_VARIABLE "QT_TEST_LIBRARIES" PREFIX "${QT_PACKAGE_PREFIX}" MODULE "Test")
foreach (TEST ${QT_TESTS})
configure_test_target(
TEST_NAME
"${TEST}_tests"
SRC_FILES
"tests/${TEST}.cpp"
LIBRARIES
"${QT_TEST_LIBRARIES}"
FULL_TEST_NAME_OUT_VAR
FULL_TEST_NAME_${TEST})
# avoid running wizard tests in parallel with other tests spawning a Syncthing test instance
if ("${TEST}" STREQUAL "wizard")
set_tests_properties("${FULL_TEST_NAME_${TEST}}" PROPERTIES RESOURCE_LOCK "syncthingtestinstance")
set_tests_properties("${FULL_TEST_NAME_${TEST}}" PROPERTIES ENVIRONMENT "LIB_SYNCTHING_CONNECTOR_LOG_ALL=1")
endif ()
2022-10-16 15:08:29 +02:00
endforeach ()