2017-04-01 16:56:36 +02:00
|
|
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
|
|
|
|
|
|
|
# metadata
|
|
|
|
set(META_PROJECT_NAME syncthingtesthelper)
|
|
|
|
set(META_PROJECT_TYPE library)
|
|
|
|
set(META_APP_NAME "Syncthing Tray Test Helper")
|
2021-07-03 19:29:49 +02:00
|
|
|
set(META_APP_DESCRIPTION "Helper for testing components of Syncthing Tray")
|
2017-04-01 16:56:36 +02:00
|
|
|
set(META_PUBLIC_QT_MODULES Core)
|
|
|
|
set(META_NO_INSTALL_TARGETS ON)
|
2018-01-27 16:04:17 +01:00
|
|
|
set(META_NO_CPP_UNIT ON)
|
2018-01-27 23:57:02 +01:00
|
|
|
set(META_TEST_TARGET_IS_MANUAL ON)
|
2019-01-13 22:16:23 +01:00
|
|
|
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION OFF)
|
2017-04-01 16:56:36 +02:00
|
|
|
|
|
|
|
# add project files
|
2019-02-06 17:36:14 +01:00
|
|
|
set(HEADER_FILES helper.h syncthingtestinstance.h)
|
|
|
|
set(SRC_FILES helper.cpp syncthingtestinstance.cpp)
|
2017-04-01 16:56:36 +02:00
|
|
|
|
2019-02-06 17:36:14 +01:00
|
|
|
set(TEST_HEADER_FILES)
|
|
|
|
set(TEST_SRC_FILES tests/manualtesting.cpp)
|
2017-04-01 16:56:36 +02:00
|
|
|
|
2019-02-06 17:36:14 +01:00
|
|
|
set(TS_FILES)
|
2017-04-01 16:56:36 +02:00
|
|
|
|
2020-02-14 23:04:10 +01:00
|
|
|
# don't allow adding a target suffix to the test library
|
|
|
|
set(SYNCTHINGTESTHELPER_CONFIGURATION_TARGET_SUFFIX none)
|
|
|
|
|
2017-04-01 16:56:36 +02:00
|
|
|
# find c++utilities
|
2021-10-02 11:58:02 +02:00
|
|
|
find_package(${PACKAGE_NAMESPACE_PREFIX}c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
|
2017-04-01 16:56:36 +02:00
|
|
|
use_cpp_utilities()
|
|
|
|
|
2017-07-11 22:40:04 +02:00
|
|
|
# find qtutilities (only CMake modules used)
|
2021-10-02 11:58:02 +02:00
|
|
|
find_package(${PACKAGE_NAMESPACE_PREFIX}qtutilities${CONFIGURATION_PACKAGE_SUFFIX_QTUTILITIES} 6.0.0 REQUIRED)
|
2017-04-01 16:56:36 +02:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${QT_UTILITIES_MODULE_DIRS})
|
|
|
|
|
2017-07-11 22:40:04 +02:00
|
|
|
# find syncthingconnector
|
|
|
|
find_package(syncthingconnector ${META_APP_VERSION} REQUIRED)
|
|
|
|
use_syncthingconnector()
|
|
|
|
|
2021-07-03 19:29:49 +02:00
|
|
|
# link also explicitly against the following Qt modules
|
2017-04-01 16:56:36 +02:00
|
|
|
list(APPEND ADDITIONAL_QT_MODULES Network)
|
|
|
|
|
|
|
|
# include modules to apply configuration
|
|
|
|
include(BasicConfig)
|
|
|
|
include(QtConfig)
|
|
|
|
include(WindowsResources)
|
|
|
|
include(LibraryTarget)
|
2018-01-27 16:04:17 +01:00
|
|
|
include(TestTarget)
|
2017-04-01 16:56:36 +02:00
|
|
|
include(Doxygen)
|
|
|
|
include(ConfigHeader)
|
|
|
|
|
2019-03-13 19:12:23 +01:00
|
|
|
# exclude the target from 'all' target so it is only built when tests are built
|
|
|
|
set_target_properties("${META_TARGET_NAME}" PROPERTIES EXCLUDE_FROM_ALL ON)
|
2021-10-13 00:14:35 +02:00
|
|
|
|
|
|
|
# avoid running this test in parallel with other tests spawning a Syncthing test instance
|
|
|
|
if (META_MAIN_TEST_NAME)
|
|
|
|
set_tests_properties("${META_MAIN_TEST_NAME}" PROPERTIES RESOURCE_LOCK "syncthingtestinstance")
|
|
|
|
endif ()
|