Apply cmake-format
This commit is contained in:
parent
a1a9db30f9
commit
326f03b604
|
@ -8,21 +8,10 @@ set(META_PROJECT_TYPE application)
|
||||||
set(META_JS_SRC_DIR .)
|
set(META_JS_SRC_DIR .)
|
||||||
|
|
||||||
# add project files
|
# add project files
|
||||||
set(HEADER_FILES
|
set(HEADER_FILES helper.h args.h application.h)
|
||||||
helper.h
|
set(SRC_FILES main.cpp args.cpp application.cpp)
|
||||||
args.h
|
set(TEST_HEADER_FILES)
|
||||||
application.h
|
set(TEST_SRC_FILES tests/application.cpp)
|
||||||
)
|
|
||||||
set(SRC_FILES
|
|
||||||
main.cpp
|
|
||||||
args.cpp
|
|
||||||
application.cpp
|
|
||||||
)
|
|
||||||
set(TEST_HEADER_FILES
|
|
||||||
)
|
|
||||||
set(TEST_SRC_FILES
|
|
||||||
tests/application.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
# find c++utilities
|
# find c++utilities
|
||||||
find_package(c++utilities 4.17.0 REQUIRED)
|
find_package(c++utilities 4.17.0 REQUIRED)
|
||||||
|
@ -37,28 +26,28 @@ find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
|
||||||
use_syncthingconnector()
|
use_syncthingconnector()
|
||||||
|
|
||||||
find_package(syncthingtesthelper ${META_APP_VERSION} REQUIRED)
|
find_package(syncthingtesthelper ${META_APP_VERSION} REQUIRED)
|
||||||
if(SYNCTHINGTESTHELPER_HAS_SHARED_LIB)
|
if (SYNCTHINGTESTHELPER_HAS_SHARED_LIB)
|
||||||
list(APPEND TEST_LIBRARIES syncthingtesthelper)
|
list(APPEND TEST_LIBRARIES syncthingtesthelper)
|
||||||
elseif(SYNCTHINGTESTHELPER_HAS_STATIC_LIB)
|
elseif (SYNCTHINGTESTHELPER_HAS_STATIC_LIB)
|
||||||
list(APPEND TEST_LIBRARIES syncthingtesthelper_static)
|
list(APPEND TEST_LIBRARIES syncthingtesthelper_static)
|
||||||
else()
|
else ()
|
||||||
message(WARNING "Unable to build tests. Testhelper not found.")
|
message(WARNING "Unable to build tests. Testhelper not found.")
|
||||||
endif()
|
endif ()
|
||||||
|
|
||||||
# include modules to apply configuration
|
# include modules to apply configuration
|
||||||
include(BasicConfig)
|
include(BasicConfig)
|
||||||
include(JsProviderConfig)
|
include(JsProviderConfig)
|
||||||
if(JS_PROVIDER)
|
if (JS_PROVIDER)
|
||||||
list(APPEND HEADER_FILES jsconsole.h)
|
list(APPEND HEADER_FILES jsconsole.h)
|
||||||
list(APPEND SRC_FILES jsconsole.cpp)
|
list(APPEND SRC_FILES jsconsole.cpp)
|
||||||
list(APPEND RES_FILES resources/js/js.qrc)
|
list(APPEND RES_FILES resources/js/js.qrc)
|
||||||
endif()
|
endif ()
|
||||||
include(QtConfig)
|
include(QtConfig)
|
||||||
include(WindowsResources)
|
include(WindowsResources)
|
||||||
include(AppTarget)
|
include(AppTarget)
|
||||||
if(SYNCTHINGTESTHELPER_HAS_SHARED_LIB OR SYNCTHINGTESTHELPER_HAS_STATIC_LIB)
|
if (SYNCTHINGTESTHELPER_HAS_SHARED_LIB OR SYNCTHINGTESTHELPER_HAS_STATIC_LIB)
|
||||||
include(TestTarget)
|
include(TestTarget)
|
||||||
endif()
|
endif ()
|
||||||
include(ShellCompletion)
|
include(ShellCompletion)
|
||||||
include(Doxygen)
|
include(Doxygen)
|
||||||
include(ConfigHeader)
|
include(ConfigHeader)
|
||||||
|
|
|
@ -18,8 +18,7 @@ set(HEADER_FILES
|
||||||
syncthingconfig.h
|
syncthingconfig.h
|
||||||
syncthingprocess.h
|
syncthingprocess.h
|
||||||
syncthingservice.h
|
syncthingservice.h
|
||||||
utils.h
|
utils.h)
|
||||||
)
|
|
||||||
set(SRC_FILES
|
set(SRC_FILES
|
||||||
syncthingdir.cpp
|
syncthingdir.cpp
|
||||||
syncthingdev.cpp
|
syncthingdev.cpp
|
||||||
|
@ -30,20 +29,12 @@ set(SRC_FILES
|
||||||
syncthingconfig.cpp
|
syncthingconfig.cpp
|
||||||
syncthingprocess.cpp
|
syncthingprocess.cpp
|
||||||
syncthingservice.cpp
|
syncthingservice.cpp
|
||||||
utils.cpp
|
utils.cpp)
|
||||||
)
|
|
||||||
|
|
||||||
set(TEST_HEADER_FILES
|
set(TEST_HEADER_FILES)
|
||||||
)
|
set(TEST_SRC_FILES tests/connectiontests.cpp tests/misctests.cpp)
|
||||||
set(TEST_SRC_FILES
|
|
||||||
tests/connectiontests.cpp
|
|
||||||
tests/misctests.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set(TS_FILES
|
set(TS_FILES translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
|
||||||
translations/${META_PROJECT_NAME}_de_DE.ts
|
|
||||||
translations/${META_PROJECT_NAME}_en_US.ts
|
|
||||||
)
|
|
||||||
|
|
||||||
# find c++utilities
|
# find c++utilities
|
||||||
find_package(c++utilities 4.17.0 REQUIRED)
|
find_package(c++utilities 4.17.0 REQUIRED)
|
||||||
|
@ -62,76 +53,67 @@ list(APPEND ADDITIONAL_QT_MODULES Network)
|
||||||
set(META_PUBLIC_QT_MODULES Core ${ADDITIONAL_QT_MODULES})
|
set(META_PUBLIC_QT_MODULES Core ${ADDITIONAL_QT_MODULES})
|
||||||
|
|
||||||
# configure support for controlling Syncthing via systemd service
|
# configure support for controlling Syncthing via systemd service
|
||||||
if(UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE)
|
||||||
set(ENABLE_SYSTEMD_SUPPORT_BY_DEFAULT ON)
|
set(ENABLE_SYSTEMD_SUPPORT_BY_DEFAULT ON)
|
||||||
else()
|
else ()
|
||||||
set(ENABLE_SYSTEMD_SUPPORT_BY_DEFAULT OFF)
|
set(ENABLE_SYSTEMD_SUPPORT_BY_DEFAULT OFF)
|
||||||
endif()
|
endif ()
|
||||||
option(SYSTEMD_SUPPORT "enables support for controlling Syncthing systemd service" ${ENABLE_SYSTEMD_SUPPORT_BY_DEFAULT})
|
option(SYSTEMD_SUPPORT "enables support for controlling Syncthing systemd service" ${ENABLE_SYSTEMD_SUPPORT_BY_DEFAULT})
|
||||||
if(SYSTEMD_SUPPORT)
|
if (SYSTEMD_SUPPORT)
|
||||||
list(APPEND DBUS_FILES
|
list(APPEND DBUS_FILES
|
||||||
org.freedesktop.DBus.Properties.xml
|
org.freedesktop.DBus.Properties.xml
|
||||||
org.freedesktop.login1.LoginManager.xml
|
org.freedesktop.login1.LoginManager.xml
|
||||||
org.freedesktop.systemd1.Manager.xml
|
org.freedesktop.systemd1.Manager.xml
|
||||||
org.freedesktop.systemd1.Service.xml
|
org.freedesktop.systemd1.Service.xml
|
||||||
org.freedesktop.systemd1.Unit.xml
|
org.freedesktop.systemd1.Unit.xml)
|
||||||
)
|
set_source_files_properties(org.freedesktop.systemd1.Manager.xml PROPERTIES INCLUDE syncthingservice.h)
|
||||||
set_source_files_properties(
|
|
||||||
org.freedesktop.systemd1.Manager.xml
|
|
||||||
PROPERTIES INCLUDE syncthingservice.h
|
|
||||||
)
|
|
||||||
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_SUPPORT_SYSTEMD)
|
list(APPEND META_PUBLIC_COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_SUPPORT_SYSTEMD)
|
||||||
message(STATUS "systemd support enabled")
|
message(STATUS "systemd support enabled")
|
||||||
else()
|
else ()
|
||||||
message(STATUS "systemd support disabled")
|
message(STATUS "systemd support disabled")
|
||||||
endif()
|
endif ()
|
||||||
|
|
||||||
# configure whether the connection should be mocked for test purposes
|
# configure whether the connection should be mocked for test purposes
|
||||||
option(SYNCTHING_CONNECTION_MOCKED "enables mocking the SyncthingConnection class so it will provide only some fixed test data" OFF)
|
option(SYNCTHING_CONNECTION_MOCKED
|
||||||
if(SYNCTHING_CONNECTION_MOCKED)
|
"enables mocking the SyncthingConnection class so it will provide only some fixed test data" OFF)
|
||||||
list(APPEND SRC_FILES
|
if (SYNCTHING_CONNECTION_MOCKED)
|
||||||
syncthingconnectionmockhelpers.h
|
list(APPEND SRC_FILES syncthingconnectionmockhelpers.h syncthingconnectionmockhelpers.cpp)
|
||||||
syncthingconnectionmockhelpers.cpp
|
set_property(SOURCE syncthingconnection.cpp
|
||||||
)
|
|
||||||
set_property(
|
|
||||||
SOURCE syncthingconnection.cpp
|
|
||||||
syncthingconnection_requests.cpp
|
syncthingconnection_requests.cpp
|
||||||
syncthingconnectionmockhelpers.h
|
syncthingconnectionmockhelpers.h
|
||||||
syncthingconnectionmockhelpers.cpp
|
syncthingconnectionmockhelpers.cpp
|
||||||
APPEND PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_CONNECTION_MOCKED
|
APPEND
|
||||||
)
|
PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_CONNECTION_MOCKED)
|
||||||
message(WARNING "SyncthingConnection class will be mocked")
|
message(WARNING "SyncthingConnection class will be mocked")
|
||||||
endif()
|
endif ()
|
||||||
|
|
||||||
# configure whether the service should be mocked for test purposes
|
# configure whether the service should be mocked for test purposes
|
||||||
option(SYNCTHING_SERVICE_MOCKED "enables mocking the SyncthingService class so it will provide some fake status" OFF)
|
option(SYNCTHING_SERVICE_MOCKED "enables mocking the SyncthingService class so it will provide some fake status" OFF)
|
||||||
if(SYNCTHING_SERVICE_MOCKED)
|
if (SYNCTHING_SERVICE_MOCKED)
|
||||||
set_property(
|
set_property(SOURCE syncthingservice.cpp
|
||||||
SOURCE syncthingservice.cpp
|
APPEND
|
||||||
APPEND PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_SERVICE_MOCKED
|
PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_SERVICE_MOCKED)
|
||||||
)
|
|
||||||
message(WARNING "SyncthingService class will be mocked")
|
message(WARNING "SyncthingService class will be mocked")
|
||||||
endif()
|
endif ()
|
||||||
|
|
||||||
# configure whether events should be logged
|
# configure whether events should be logged
|
||||||
option(SYNCTHING_CONNECTION_LOG_SYNCTHING_EVENTS "enables logging event data to stdout (enable only for debugging!)" OFF)
|
option(SYNCTHING_CONNECTION_LOG_SYNCTHING_EVENTS "enables logging event data to stdout (enable only for debugging!)" OFF)
|
||||||
if(SYNCTHING_CONNECTION_LOG_SYNCTHING_EVENTS)
|
if (SYNCTHING_CONNECTION_LOG_SYNCTHING_EVENTS)
|
||||||
set_property(
|
set_property(SOURCE syncthingconnection_requests.cpp
|
||||||
SOURCE syncthingconnection_requests.cpp
|
APPEND
|
||||||
APPEND PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_LOG_SYNCTHING_EVENTS
|
PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_LOG_SYNCTHING_EVENTS)
|
||||||
)
|
|
||||||
message(WARNING "SyncthingConnection class will log event data to stdout")
|
message(WARNING "SyncthingConnection class will log event data to stdout")
|
||||||
endif()
|
endif ()
|
||||||
|
|
||||||
# configure whether POSTs should be logged
|
# configure whether POSTs should be logged
|
||||||
option(SYNCTHING_CONNECTION_LOG_API_CALLS "enables logging API calls done by the SyncthingConnector (enable only for debugging!)" OFF)
|
option(SYNCTHING_CONNECTION_LOG_API_CALLS
|
||||||
if(SYNCTHING_CONNECTION_LOG_API_CALLS)
|
"enables logging API calls done by the SyncthingConnector (enable only for debugging!)" OFF)
|
||||||
set_property(
|
if (SYNCTHING_CONNECTION_LOG_API_CALLS)
|
||||||
SOURCE syncthingconnection_requests.cpp
|
set_property(SOURCE syncthingconnection_requests.cpp
|
||||||
APPEND PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_LOG_API_CALLS
|
APPEND
|
||||||
)
|
PROPERTY COMPILE_DEFINITIONS ${META_PROJECT_VARNAME_UPPER}_LOG_API_CALLS)
|
||||||
message(WARNING "SyncthingConnection class will log API calls data to stdout")
|
message(WARNING "SyncthingConnection class will log API calls data to stdout")
|
||||||
endif()
|
endif ()
|
||||||
|
|
||||||
# include modules to apply configuration
|
# include modules to apply configuration
|
||||||
include(BasicConfig)
|
include(BasicConfig)
|
||||||
|
@ -139,13 +121,12 @@ include(QtConfig)
|
||||||
include(WindowsResources)
|
include(WindowsResources)
|
||||||
include(LibraryTarget)
|
include(LibraryTarget)
|
||||||
|
|
||||||
# link tests against test helper (can't use find_package because testhelper target is not
|
# link tests against test helper (can't use find_package because testhelper target is not present at this point)
|
||||||
# present at this point)
|
if (BUILD_SHARED_LIBS)
|
||||||
if(BUILD_SHARED_LIBS)
|
|
||||||
list(APPEND TEST_LIBRARIES syncthingtesthelper)
|
list(APPEND TEST_LIBRARIES syncthingtesthelper)
|
||||||
else()
|
else ()
|
||||||
list(APPEND TEST_LIBRARIES syncthingtesthelper_static)
|
list(APPEND TEST_LIBRARIES syncthingtesthelper_static)
|
||||||
endif()
|
endif ()
|
||||||
include(TestTarget)
|
include(TestTarget)
|
||||||
|
|
||||||
include(Doxygen)
|
include(Doxygen)
|
||||||
|
|
|
@ -11,20 +11,15 @@ set(HEADER_FILES
|
||||||
syncthinginfoaction.h
|
syncthinginfoaction.h
|
||||||
syncthingdiractions.h
|
syncthingdiractions.h
|
||||||
syncthingfileitemactionstaticdata.h
|
syncthingfileitemactionstaticdata.h
|
||||||
syncthingfileitemaction.h
|
syncthingfileitemaction.h)
|
||||||
)
|
|
||||||
set(SRC_FILES
|
set(SRC_FILES
|
||||||
syncthingmenuaction.cpp
|
syncthingmenuaction.cpp
|
||||||
syncthinginfoaction.cpp
|
syncthinginfoaction.cpp
|
||||||
syncthingdiractions.cpp
|
syncthingdiractions.cpp
|
||||||
syncthingfileitemactionstaticdata.cpp
|
syncthingfileitemactionstaticdata.cpp
|
||||||
syncthingfileitemaction.cpp
|
syncthingfileitemaction.cpp)
|
||||||
)
|
|
||||||
|
|
||||||
set(TS_FILES
|
set(TS_FILES translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
|
||||||
translations/${META_PROJECT_NAME}_de_DE.ts
|
|
||||||
translations/${META_PROJECT_NAME}_en_US.ts
|
|
||||||
)
|
|
||||||
|
|
||||||
# find c++utilities
|
# find c++utilities
|
||||||
find_package(c++utilities 4.6.0 REQUIRED)
|
find_package(c++utilities 4.6.0 REQUIRED)
|
||||||
|
@ -51,12 +46,12 @@ include(QtConfig)
|
||||||
include(WindowsResources)
|
include(WindowsResources)
|
||||||
# KIO libs can not be determined automatically
|
# KIO libs can not be determined automatically
|
||||||
list(REMOVE_ITEM PRIVATE_LIBRARIES KF5::KIO)
|
list(REMOVE_ITEM PRIVATE_LIBRARIES KF5::KIO)
|
||||||
list(APPEND PRIVATE_LIBRARIES KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::KIONTLM)
|
list(APPEND PRIVATE_LIBRARIES
|
||||||
|
KF5::KIOCore
|
||||||
|
KF5::KIOFileWidgets
|
||||||
|
KF5::KIOWidgets
|
||||||
|
KF5::KIONTLM)
|
||||||
include(LibraryTarget)
|
include(LibraryTarget)
|
||||||
include(ConfigHeader)
|
include(ConfigHeader)
|
||||||
|
|
||||||
install(
|
install(FILES ${META_PROJECT_NAME}.desktop DESTINATION "share/kservices5" COMPONENT desktop)
|
||||||
FILES ${META_PROJECT_NAME}.desktop
|
|
||||||
DESTINATION "share/kservices5"
|
|
||||||
COMPONENT desktop
|
|
||||||
)
|
|
||||||
|
|
|
@ -18,24 +18,17 @@ set(HEADER_FILES
|
||||||
syncthingdownloadmodel.h
|
syncthingdownloadmodel.h
|
||||||
syncthingstatusselectionmodel.h
|
syncthingstatusselectionmodel.h
|
||||||
syncthingicons.h
|
syncthingicons.h
|
||||||
colors.h
|
colors.h)
|
||||||
)
|
|
||||||
set(SRC_FILES
|
set(SRC_FILES
|
||||||
syncthingmodel.cpp
|
syncthingmodel.cpp
|
||||||
syncthingdirectorymodel.cpp
|
syncthingdirectorymodel.cpp
|
||||||
syncthingdevicemodel.cpp
|
syncthingdevicemodel.cpp
|
||||||
syncthingdownloadmodel.cpp
|
syncthingdownloadmodel.cpp
|
||||||
syncthingstatusselectionmodel.cpp
|
syncthingstatusselectionmodel.cpp
|
||||||
syncthingicons.cpp
|
syncthingicons.cpp)
|
||||||
)
|
set(RES_FILES resources/${META_PROJECT_NAME}icons.qrc)
|
||||||
set(RES_FILES
|
|
||||||
resources/${META_PROJECT_NAME}icons.qrc
|
|
||||||
)
|
|
||||||
|
|
||||||
set(TS_FILES
|
set(TS_FILES translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
|
||||||
translations/${META_PROJECT_NAME}_de_DE.ts
|
|
||||||
translations/${META_PROJECT_NAME}_en_US.ts
|
|
||||||
)
|
|
||||||
|
|
||||||
# find c++utilities
|
# find c++utilities
|
||||||
find_package(c++utilities 4.0.0 REQUIRED)
|
find_package(c++utilities 4.0.0 REQUIRED)
|
||||||
|
@ -50,7 +43,11 @@ find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
|
||||||
use_syncthingconnector()
|
use_syncthingconnector()
|
||||||
|
|
||||||
# link also explicitely against the following Qt 5 modules
|
# link also explicitely against the following Qt 5 modules
|
||||||
list(APPEND ADDITIONAL_QT_MODULES Network Gui Widgets Svg)
|
list(APPEND ADDITIONAL_QT_MODULES
|
||||||
|
Network
|
||||||
|
Gui
|
||||||
|
Widgets
|
||||||
|
Svg)
|
||||||
|
|
||||||
# include modules to apply configuration
|
# include modules to apply configuration
|
||||||
include(BasicConfig)
|
include(BasicConfig)
|
||||||
|
|
|
@ -1,15 +1,7 @@
|
||||||
# source files
|
# source files
|
||||||
set(HEADER_FILES
|
set(HEADER_FILES syncthingapplet.h settingsdialog.h)
|
||||||
syncthingapplet.h
|
set(SRC_FILES syncthingapplet.cpp settingsdialog.cpp)
|
||||||
settingsdialog.h
|
set(WIDGETS_UI_FILES appearanceoptionpage.ui)
|
||||||
)
|
|
||||||
set(SRC_FILES
|
|
||||||
syncthingapplet.cpp
|
|
||||||
settingsdialog.cpp
|
|
||||||
)
|
|
||||||
set(WIDGETS_UI_FILES
|
|
||||||
appearanceoptionpage.ui
|
|
||||||
)
|
|
||||||
set(PLASMOID_FILES
|
set(PLASMOID_FILES
|
||||||
../package/metadata.desktop
|
../package/metadata.desktop
|
||||||
../package/contents/ui/CompactRepresentation.qml
|
../package/contents/ui/CompactRepresentation.qml
|
||||||
|
@ -25,14 +17,10 @@ set(PLASMOID_FILES
|
||||||
../package/contents/ui/TinyButton.qml
|
../package/contents/ui/TinyButton.qml
|
||||||
../package/contents/ui/TinyButtonStyle.qml
|
../package/contents/ui/TinyButtonStyle.qml
|
||||||
../package/contents/ui/ButtonShadow.qml
|
../package/contents/ui/ButtonShadow.qml
|
||||||
../package/contents/ui/main.qml
|
../package/contents/ui/main.qml)
|
||||||
)
|
|
||||||
list(APPEND QML_SRC_FILES ${PLASMOID_FILES})
|
list(APPEND QML_SRC_FILES ${PLASMOID_FILES})
|
||||||
|
|
||||||
set(TS_FILES
|
set(TS_FILES ../translations/${META_PROJECT_NAME}_de_DE.ts ../translations/${META_PROJECT_NAME}_en_US.ts)
|
||||||
../translations/${META_PROJECT_NAME}_de_DE.ts
|
|
||||||
../translations/${META_PROJECT_NAME}_en_US.ts
|
|
||||||
)
|
|
||||||
|
|
||||||
# find c++utilities
|
# find c++utilities
|
||||||
find_package(c++utilities 4.10.0 REQUIRED)
|
find_package(c++utilities 4.10.0 REQUIRED)
|
||||||
|
@ -45,9 +33,11 @@ use_qt_utilities()
|
||||||
# check whether qtutilities supports DBus notifications
|
# check whether qtutilities supports DBus notifications
|
||||||
get_target_property(QT_UTILITIES_COMPILE_DEFINITIONS ${QT_UTILITIES_LIB} INTERFACE_COMPILE_DEFINITIONS)
|
get_target_property(QT_UTILITIES_COMPILE_DEFINITIONS ${QT_UTILITIES_LIB} INTERFACE_COMPILE_DEFINITIONS)
|
||||||
list(FIND QT_UTILITIES_COMPILE_DEFINITIONS QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS)
|
list(FIND QT_UTILITIES_COMPILE_DEFINITIONS QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS)
|
||||||
if(QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS LESS 0)
|
if (QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS LESS 0)
|
||||||
message(FATAL_ERROR "The provided build of Qt Utilities does not support D-Bus notifications which is required for the Plasmoid.")
|
message(
|
||||||
endif()
|
FATAL_ERROR
|
||||||
|
"The provided build of Qt Utilities does not support D-Bus notifications which is required for the Plasmoid.")
|
||||||
|
endif ()
|
||||||
|
|
||||||
# find backend libraries
|
# find backend libraries
|
||||||
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
|
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
|
||||||
|
|
|
@ -12,23 +12,13 @@ set(META_TEST_TARGET_IS_MANUAL ON)
|
||||||
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION OFF)
|
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION OFF)
|
||||||
|
|
||||||
# add project files
|
# add project files
|
||||||
set(HEADER_FILES
|
set(HEADER_FILES helper.h syncthingtestinstance.h)
|
||||||
helper.h
|
set(SRC_FILES helper.cpp syncthingtestinstance.cpp)
|
||||||
syncthingtestinstance.h
|
|
||||||
)
|
|
||||||
set(SRC_FILES
|
|
||||||
helper.cpp
|
|
||||||
syncthingtestinstance.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set(TEST_HEADER_FILES
|
set(TEST_HEADER_FILES)
|
||||||
)
|
set(TEST_SRC_FILES tests/manualtesting.cpp)
|
||||||
set(TEST_SRC_FILES
|
|
||||||
tests/manualtesting.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set(TS_FILES
|
set(TS_FILES)
|
||||||
)
|
|
||||||
|
|
||||||
# find c++utilities
|
# find c++utilities
|
||||||
find_package(c++utilities 4.16.0 REQUIRED)
|
find_package(c++utilities 4.16.0 REQUIRED)
|
||||||
|
@ -57,8 +47,9 @@ include(Doxygen)
|
||||||
include(ConfigHeader)
|
include(ConfigHeader)
|
||||||
|
|
||||||
# exclude the targets from 'all' target so it is only built when tests are built
|
# exclude the targets from 'all' target so it is only built when tests are built
|
||||||
foreach(TESTHELPER_TARGET "${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}" "${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}_static")
|
foreach (TESTHELPER_TARGET "${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}"
|
||||||
if(TARGET "${TESTHELPER_TARGET}")
|
"${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}_static")
|
||||||
|
if (TARGET "${TESTHELPER_TARGET}")
|
||||||
set_target_properties("${TESTHELPER_TARGET}" PROPERTIES EXCLUDE_FROM_ALL ON)
|
set_target_properties("${TESTHELPER_TARGET}" PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||||
endif()
|
endif ()
|
||||||
endforeach()
|
endforeach ()
|
||||||
|
|
|
@ -17,8 +17,7 @@ set(WIDGETS_HEADER_FILES
|
||||||
gui/downloaditemdelegate.h
|
gui/downloaditemdelegate.h
|
||||||
gui/dirview.h
|
gui/dirview.h
|
||||||
gui/devview.h
|
gui/devview.h
|
||||||
gui/downloadview.h
|
gui/downloadview.h)
|
||||||
)
|
|
||||||
set(WIDGETS_SRC_FILES
|
set(WIDGETS_SRC_FILES
|
||||||
application/main.cpp
|
application/main.cpp
|
||||||
application/singleinstance.cpp
|
application/singleinstance.cpp
|
||||||
|
@ -30,29 +29,17 @@ set(WIDGETS_SRC_FILES
|
||||||
gui/downloaditemdelegate.cpp
|
gui/downloaditemdelegate.cpp
|
||||||
gui/dirview.cpp
|
gui/dirview.cpp
|
||||||
gui/devview.cpp
|
gui/devview.cpp
|
||||||
gui/downloadview.cpp
|
gui/downloadview.cpp)
|
||||||
)
|
set(RES_FILES resources/${META_PROJECT_NAME}icons.qrc)
|
||||||
set(RES_FILES
|
set(WIDGETS_UI_FILES gui/traywidget.ui)
|
||||||
resources/${META_PROJECT_NAME}icons.qrc
|
|
||||||
)
|
|
||||||
set(WIDGETS_UI_FILES
|
|
||||||
gui/traywidget.ui
|
|
||||||
)
|
|
||||||
|
|
||||||
set(TS_FILES
|
set(TS_FILES translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
|
||||||
translations/${META_PROJECT_NAME}_de_DE.ts
|
|
||||||
translations/${META_PROJECT_NAME}_en_US.ts
|
|
||||||
)
|
|
||||||
|
|
||||||
set(ICON_FILES
|
set(ICON_FILES resources/icons/hicolor/scalable/app/${META_PROJECT_NAME}.svg)
|
||||||
resources/icons/hicolor/scalable/app/${META_PROJECT_NAME}.svg
|
|
||||||
)
|
|
||||||
set(PNG_ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/hicolor/scalable/app/${META_PROJECT_NAME}.png")
|
set(PNG_ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/hicolor/scalable/app/${META_PROJECT_NAME}.png")
|
||||||
set(PNG_ICON_NO_CROP ON)
|
set(PNG_ICON_NO_CROP ON)
|
||||||
|
|
||||||
set(DOC_FILES
|
set(DOC_FILES README.md)
|
||||||
README.md
|
|
||||||
)
|
|
||||||
|
|
||||||
set(REQUIRED_ICONS
|
set(REQUIRED_ICONS
|
||||||
dialog-cancel
|
dialog-cancel
|
||||||
|
@ -89,10 +76,8 @@ set(REQUIRED_ICONS
|
||||||
text-plain
|
text-plain
|
||||||
view-barcode
|
view-barcode
|
||||||
view-refresh
|
view-refresh
|
||||||
window-close
|
window-close)
|
||||||
)
|
# fallback icons can not replace built-in Breeze icons (yet) set(FALLBACK_ICON_THEME breeze)
|
||||||
# fallback icons can not replace built-in Breeze icons (yet)
|
|
||||||
#set(FALLBACK_ICON_THEME breeze)
|
|
||||||
|
|
||||||
# find c++utilities
|
# find c++utilities
|
||||||
find_package(c++utilities 4.11.0 REQUIRED)
|
find_package(c++utilities 4.11.0 REQUIRED)
|
||||||
|
|
|
@ -23,8 +23,7 @@ set(WIDGETS_HEADER_FILES
|
||||||
misc/internalerror.h
|
misc/internalerror.h
|
||||||
misc/otherdialogs.h
|
misc/otherdialogs.h
|
||||||
misc/syncthinglauncher.h
|
misc/syncthinglauncher.h
|
||||||
misc/syncthingkiller.h
|
misc/syncthingkiller.h)
|
||||||
)
|
|
||||||
set(WIDGETS_SRC_FILES
|
set(WIDGETS_SRC_FILES
|
||||||
settings/settings.cpp
|
settings/settings.cpp
|
||||||
settings/settingsdialog.cpp
|
settings/settingsdialog.cpp
|
||||||
|
@ -40,11 +39,8 @@ set(WIDGETS_SRC_FILES
|
||||||
misc/internalerror.cpp
|
misc/internalerror.cpp
|
||||||
misc/otherdialogs.cpp
|
misc/otherdialogs.cpp
|
||||||
misc/syncthinglauncher.cpp
|
misc/syncthinglauncher.cpp
|
||||||
misc/syncthingkiller.cpp
|
misc/syncthingkiller.cpp)
|
||||||
)
|
set(RES_FILES resources/${META_PROJECT_NAME}icons.qrc)
|
||||||
set(RES_FILES
|
|
||||||
resources/${META_PROJECT_NAME}icons.qrc
|
|
||||||
)
|
|
||||||
set(WIDGETS_UI_FILES
|
set(WIDGETS_UI_FILES
|
||||||
settings/connectionoptionpage.ui
|
settings/connectionoptionpage.ui
|
||||||
settings/notificationsoptionpage.ui
|
settings/notificationsoptionpage.ui
|
||||||
|
@ -52,13 +48,9 @@ set(WIDGETS_UI_FILES
|
||||||
settings/autostartoptionpage.ui
|
settings/autostartoptionpage.ui
|
||||||
settings/launcheroptionpage.ui
|
settings/launcheroptionpage.ui
|
||||||
settings/systemdoptionpage.ui
|
settings/systemdoptionpage.ui
|
||||||
settings/webviewoptionpage.ui
|
settings/webviewoptionpage.ui)
|
||||||
)
|
|
||||||
|
|
||||||
set(TS_FILES
|
set(TS_FILES translations/${META_PROJECT_NAME}_de_DE.ts translations/${META_PROJECT_NAME}_en_US.ts)
|
||||||
translations/${META_PROJECT_NAME}_de_DE.ts
|
|
||||||
translations/${META_PROJECT_NAME}_en_US.ts
|
|
||||||
)
|
|
||||||
|
|
||||||
set(REQUIRED_ICONS
|
set(REQUIRED_ICONS
|
||||||
preferences-other
|
preferences-other
|
||||||
|
@ -75,8 +67,7 @@ set(REQUIRED_ICONS
|
||||||
network-connect
|
network-connect
|
||||||
emblem-remove
|
emblem-remove
|
||||||
go-down
|
go-down
|
||||||
go-up
|
go-up)
|
||||||
)
|
|
||||||
|
|
||||||
# find c++utilities
|
# find c++utilities
|
||||||
find_package(c++utilities 4.6.0 REQUIRED)
|
find_package(c++utilities 4.6.0 REQUIRED)
|
||||||
|
@ -94,24 +85,18 @@ use_syncthingmodel()
|
||||||
|
|
||||||
# configure libsyncthing
|
# configure libsyncthing
|
||||||
option(USE_LIBSYNCTHING "whether libsyncthing should be included for the launcher" OFF)
|
option(USE_LIBSYNCTHING "whether libsyncthing should be included for the launcher" OFF)
|
||||||
if(USE_LIBSYNCTHING)
|
if (USE_LIBSYNCTHING)
|
||||||
find_package(syncthing ${META_APP_VERSION} REQUIRED)
|
find_package(syncthing ${META_APP_VERSION} REQUIRED)
|
||||||
use_syncthing()
|
use_syncthing()
|
||||||
set_source_files_properties(
|
set_source_files_properties(misc/syncthinglauncher.cpp PROPERTIES COMPILE_DEFINITIONS SYNCTHINGWIDGETS_USE_LIBSYNCTHING)
|
||||||
misc/syncthinglauncher.cpp
|
endif ()
|
||||||
PROPERTIES COMPILE_DEFINITIONS SYNCTHINGWIDGETS_USE_LIBSYNCTHING
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# configure logging JavaScript events to stderr
|
# configure logging JavaScript events to stderr
|
||||||
option(SYNCTHING_WIDGETS_LOG_JAVASCRIPT_CONSOLE "enables logging JavaScript events of webview to stderr" OFF)
|
option(SYNCTHING_WIDGETS_LOG_JAVASCRIPT_CONSOLE "enables logging JavaScript events of webview to stderr" OFF)
|
||||||
if(SYNCTHING_WIDGETS_LOG_JAVASCRIPT_CONSOLE)
|
if (SYNCTHING_WIDGETS_LOG_JAVASCRIPT_CONSOLE)
|
||||||
set_property(
|
set_property(SOURCE webview/webpage.cpp APPEND PROPERTY COMPILE_DEFINITIONS SYNCTHINGWIDGETS_LOG_JAVASCRIPT_CONSOLE)
|
||||||
SOURCE webview/webpage.cpp
|
|
||||||
APPEND PROPERTY COMPILE_DEFINITIONS SYNCTHINGWIDGETS_LOG_JAVASCRIPT_CONSOLE
|
|
||||||
)
|
|
||||||
message(WARNING "JavaScript console of web view will be logged to stderr")
|
message(WARNING "JavaScript console of web view will be logged to stderr")
|
||||||
endif()
|
endif ()
|
||||||
|
|
||||||
# link also explicitely against the following Qt 5 modules
|
# link also explicitely against the following Qt 5 modules
|
||||||
list(APPEND ADDITIONAL_QT_MODULES Network Concurrent)
|
list(APPEND ADDITIONAL_QT_MODULES Network Concurrent)
|
||||||
|
|
Loading…
Reference in New Issue