2016-08-25 00:45:32 +02:00
cmake_minimum_required ( VERSION 3.1.0 FATAL_ERROR )
2020-03-05 19:04:55 +01:00
# define metadata
2016-08-25 00:45:32 +02:00
set ( META_PROJECT_NAME syncthingtray )
set ( META_APP_AUTHOR "Martchus" )
2020-02-14 23:04:10 +01:00
set ( META_APP_AUTHOR_MAIL "martchus@gmx.net" )
2016-08-25 00:45:32 +02:00
set ( META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}" )
set ( META_APP_DESCRIPTION "Tray application for Syncthing" )
2018-02-10 23:18:30 +01:00
set ( META_APP_CATEGORIES "Network;FileTransfer" )
2017-09-09 20:24:59 +02:00
set ( META_GUI_OPTIONAL false )
2020-08-18 01:16:21 +02:00
set ( META_VERSION_MAJOR 1 )
2020-11-27 19:09:47 +01:00
set ( META_VERSION_MINOR 1 )
2021-09-11 02:20:38 +02:00
set ( META_VERSION_PATCH 11 )
2016-10-22 21:01:32 +02:00
set ( META_VERSION_EXACT_SONAME ON )
2019-01-13 22:16:23 +01:00
set ( META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON )
2016-08-25 00:45:32 +02:00
2016-09-30 23:55:25 +02:00
project ( ${ META_PROJECT_NAME } )
2021-09-11 18:08:51 +02:00
enable_testing ( )
2016-09-30 23:55:25 +02:00
2020-03-05 19:04:55 +01:00
# disable KDE integration under Android, Windows and MacOS by default
2017-07-20 00:02:05 +02:00
if ( ANDROID OR WIN32 OR APPLE )
set ( FILE_ITEM_ACTION_PLUGIN_DISABLED_BY_DEFAULT ON )
2017-08-29 23:58:49 +02:00
set ( PLASMOID_DISABLED_BY_DEFAULT ON )
2017-07-20 00:02:05 +02:00
else ( )
set ( FILE_ITEM_ACTION_PLUGIN_DISABLED_BY_DEFAULT OFF )
2017-10-05 00:31:30 +02:00
set ( PLASMOID_DISABLED_BY_DEFAULT OFF )
2017-07-20 00:02:05 +02:00
endif ( )
2020-03-05 19:04:55 +01:00
# add options for partial build
2018-04-08 21:36:08 +02:00
option ( NO_LIBSYNCTHING "whether building Syncthing itself as a library should be skipped" ON )
2017-04-23 18:27:31 +02:00
option ( NO_CLI "whether building CLI should be skipped" OFF )
option ( NO_TRAY "whether building the tray should be skipped" OFF )
2017-07-20 00:02:05 +02:00
option ( NO_FILE_ITEM_ACTION_PLUGIN "whether building the file item action plugin should be skipped" "${FILE_ITEM_ACTION_PLUGIN_DISABLED_BY_DEFAULT}" )
2017-04-23 18:27:31 +02:00
option ( NO_MODEL "whether building models should be skipped, implies NO_TRAY" OFF )
option ( NO_WIDGETS "whether building widgets should be skipped, implies NO_TRAY" OFF )
2017-08-29 23:58:49 +02:00
option ( NO_PLASMOID "whether building the Plasma 5 plasmoid should be skipped" "${PLASMOID_DISABLED_BY_DEFAULT}" )
2016-09-30 23:55:25 +02:00
2019-03-13 19:12:23 +01:00
# allow using non-default configuration
set ( CONFIGURATION_PACKAGE_SUFFIX "" CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities" )
2020-10-23 17:03:47 +02:00
set ( CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES "${CONFIGURATION_PACKAGE_SUFFIX}" CACHE STRING "sets the suffix for qtutilities" )
2021-09-11 18:08:51 +02:00
set ( CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME "${CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES}" CACHE STRING "sets the suffix for qtforkawesome" )
2019-03-13 19:12:23 +01:00
2021-09-11 02:20:38 +02:00
# allow building qtforkawesome as part of this project
set ( BUNDLED_QT_FORK_AWESOME_PATH OFF CACHE PATH "specifies the (relative) path to the qtforkawesome sources for building it together with ${META_PROJECT_NAME}" )
if ( NOT BUNDLED_QT_FORK_AWESOME_PATH )
message ( STATUS "Using system qtforkawesome" )
else ( )
2021-09-11 18:08:51 +02:00
if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${BUNDLED_QT_FORK_AWESOME_PATH}" OR IS_DIRECTORY "${BUNDLED_QT_FORK_AWESOME_PATH}" )
add_subdirectory ( "${BUNDLED_QT_FORK_AWESOME_PATH}" qtforkawesome )
2021-10-02 11:58:02 +02:00
set ( ${ NAMESPACE_PREFIX } qtforkawesome ${ CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME } _DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/qtforkawesome" )
set ( ${ NAMESPACE_PREFIX } qtforkawesomeiconengine ${ CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME } _DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/iconengineplugin" )
2021-09-11 02:20:38 +02:00
else ( )
2021-09-11 18:08:51 +02:00
message ( FATAL_ERROR "Specified directory for qtforkawesome sources \" ${ BUNDLED_QT_FORK_AWESOME_PATH } \" does not exist. " )
2021-09-11 02:20:38 +02:00
endif ( )
endif ( )
2021-09-11 18:08:51 +02:00
# set the include directory used when building so the headers of the different backend libraries can be found at build time
set ( TARGET_INCLUDE_DIRECTORY_BUILD_INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include" )
2021-10-02 11:58:02 +02:00
set ( PACKAGE_NAMESPACE "" CACHE STRING "sets the prefix for find_package() calls to packages configured via c++utilities" )
if ( PACKAGE_NAMESPACE )
set ( PACKAGE_NAMESPACE_PREFIX "${PACKAGE_NAMESPACE}-" )
endif ( )
2016-09-30 23:55:25 +02:00
# add subdirectories
add_subdirectory ( connector )
2017-07-11 22:40:04 +02:00
add_subdirectory ( testhelper )
2018-04-08 21:36:08 +02:00
if ( NOT NO_LIBSYNCTHING )
add_subdirectory ( libsyncthing )
endif ( )
2016-09-30 23:55:25 +02:00
link_directories ( ${ LIB_SYNCTHING_CONNECTOR_BINARY_DIR } )
2016-10-02 21:59:28 +02:00
if ( NOT NO_CLI )
add_subdirectory ( cli )
endif ( )
2016-09-30 23:55:25 +02:00
if ( NOT NO_MODEL )
add_subdirectory ( model )
link_directories ( ${ LIB_SYNCTHING_MODEL_BINARY_DIR } )
2017-04-23 18:27:31 +02:00
if ( NOT NO_WIDGETS )
add_subdirectory ( widgets )
if ( NOT NO_TRAY )
add_subdirectory ( tray )
endif ( )
2017-08-29 23:58:49 +02:00
if ( NOT NO_PLASMOID )
add_subdirectory ( plasmoid )
endif ( )
2016-09-30 23:55:25 +02:00
endif ( )
2016-08-25 00:45:32 +02:00
endif ( )
2017-02-20 18:37:11 +01:00
if ( NOT NO_FILE_ITEM_ACTION_PLUGIN )
add_subdirectory ( fileitemactionplugin )
endif ( )