Martchus
f384d2a496
It fits better than "view-barcode" from the icon theme. This also tests using ForkAwesome icons via the custom icon engine. Unfortunately this does not seem to work within the Plasmoid so far.
86 lines
3.8 KiB
CMake
86 lines
3.8 KiB
CMake
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
|
|
|
# define metadata
|
|
set(META_PROJECT_NAME syncthingtray)
|
|
set(META_APP_AUTHOR "Martchus")
|
|
set(META_APP_AUTHOR_MAIL "martchus@gmx.net")
|
|
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
|
|
set(META_APP_DESCRIPTION "Tray application for Syncthing")
|
|
set(META_APP_CATEGORIES "Network;FileTransfer")
|
|
set(META_GUI_OPTIONAL false)
|
|
set(META_VERSION_MAJOR 1)
|
|
set(META_VERSION_MINOR 1)
|
|
set(META_VERSION_PATCH 11)
|
|
set(META_VERSION_EXACT_SONAME ON)
|
|
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
|
|
|
|
project(${META_PROJECT_NAME})
|
|
enable_testing()
|
|
|
|
# disable KDE integration under Android, Windows and MacOS by default
|
|
if(ANDROID OR WIN32 OR APPLE)
|
|
set(FILE_ITEM_ACTION_PLUGIN_DISABLED_BY_DEFAULT ON)
|
|
set(PLASMOID_DISABLED_BY_DEFAULT ON)
|
|
else()
|
|
set(FILE_ITEM_ACTION_PLUGIN_DISABLED_BY_DEFAULT OFF)
|
|
set(PLASMOID_DISABLED_BY_DEFAULT OFF)
|
|
endif()
|
|
|
|
# add options for partial build
|
|
option(NO_LIBSYNCTHING "whether building Syncthing itself as a library should be skipped" ON)
|
|
option(NO_CLI "whether building CLI should be skipped" OFF)
|
|
option(NO_TRAY "whether building the tray should be skipped" OFF)
|
|
option(NO_FILE_ITEM_ACTION_PLUGIN "whether building the file item action plugin should be skipped" "${FILE_ITEM_ACTION_PLUGIN_DISABLED_BY_DEFAULT}")
|
|
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)
|
|
option(NO_PLASMOID "whether building the Plasma 5 plasmoid should be skipped" "${PLASMOID_DISABLED_BY_DEFAULT}")
|
|
|
|
# allow using non-default configuration
|
|
set(CONFIGURATION_PACKAGE_SUFFIX "" CACHE STRING "sets the suffix for find_package() calls to packages configured via c++utilities")
|
|
set(CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES "${CONFIGURATION_PACKAGE_SUFFIX}" CACHE STRING "sets the suffix for qtutilities")
|
|
set(CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME "${CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES}" CACHE STRING "sets the suffix for qtforkawesome")
|
|
|
|
# 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()
|
|
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)
|
|
set(qtforkawesome${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/qtforkawesome")
|
|
set(qtforkawesomeiconengine${CONFIGURATION_PACKAGE_SUFFIX_QTFORKAWESOME}_DIR "${CMAKE_CURRENT_BINARY_DIR}/qtforkawesome/iconengineplugin")
|
|
else()
|
|
message(FATAL_ERROR "Specified directory for qtforkawesome sources \"${BUNDLED_QT_FORK_AWESOME_PATH}\" does not exist.")
|
|
endif()
|
|
endif()
|
|
|
|
# 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")
|
|
|
|
# add subdirectories
|
|
add_subdirectory(connector)
|
|
add_subdirectory(testhelper)
|
|
if (NOT NO_LIBSYNCTHING)
|
|
add_subdirectory(libsyncthing)
|
|
endif()
|
|
link_directories(${LIB_SYNCTHING_CONNECTOR_BINARY_DIR})
|
|
if(NOT NO_CLI)
|
|
add_subdirectory(cli)
|
|
endif()
|
|
if(NOT NO_MODEL)
|
|
add_subdirectory(model)
|
|
link_directories(${LIB_SYNCTHING_MODEL_BINARY_DIR})
|
|
if(NOT NO_WIDGETS)
|
|
add_subdirectory(widgets)
|
|
if(NOT NO_TRAY)
|
|
add_subdirectory(tray)
|
|
endif()
|
|
if(NOT NO_PLASMOID)
|
|
add_subdirectory(plasmoid)
|
|
endif()
|
|
endif()
|
|
endif()
|
|
if(NOT NO_FILE_ITEM_ACTION_PLUGIN)
|
|
add_subdirectory(fileitemactionplugin)
|
|
endif()
|