Warning, /pim/mimetreeparser/autotests/core/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # SPDX-FileCopyrightText: 2017 Christian Mollekopf <mollekopf@kolabsys.com>
0002 # SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
0003 # SPDX-License-Identifier: BSD-3-Clause
0004
0005 set(AUTOMOC ON)
0006 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
0007 add_definitions(-DMAIL_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../testdata" )
0008
0009 include(ECMAddTests)
0010 include(${CMAKE_SOURCE_DIR}/cmake/modules/add_gpg_crypto_test.cmake)
0011
0012 function(add_mimetreeparser_class_unittest _name _additionalSource)
0013 add_executable(${_name} ${_name}.cpp setupenv.cpp ${_additionalSource})
0014 target_link_libraries(${_name} PRIVATE
0015 Qt::Test
0016 KPim6::MimeTreeParserCore
0017 )
0018 target_include_directories(${_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
0019 add_test(NAME core-${_name} COMMAND $<TARGET_FILE:${_name}>)
0020 endfunction()
0021
0022 function(add_mimetreeparser_crypto_unittest _name)
0023 add_executable(${_name} ${_name}.cpp ../setupenv.cpp)
0024 target_link_libraries(${_name} PRIVATE Gpgmepp)
0025 target_include_directories(${_name} PRIVATE
0026 ${CMAKE_CURRENT_SOURCE_DIR}/..
0027 ${GPGME_INCLUDE_DIRS}
0028 )
0029 target_link_libraries(${_name} PRIVATE
0030 Qt::Test
0031 KPim6::MimeTreeParserCore
0032 )
0033 add_gpg_crypto_test(${_name} core-${_name})
0034 endfunction()
0035
0036 add_mimetreeparser_crypto_unittest(attachmenttest)
0037
0038 add_definitions( -DMAIL_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../testdata" )
0039 include(${CMAKE_SOURCE_DIR}/cmake/modules/add_gpg_crypto_test.cmake)
0040 include_directories(
0041 ${CMAKE_CURRENT_BINARY_DIR}
0042 ${CMAKE_CURRENT_SOURCE_DIR}/..
0043 )
0044 include_directories(${GPGME_INCLUDE_DIRS})
0045
0046 include(ECMAddTests)
0047
0048 add_executable(cryptohelpertest cryptohelpertest.cpp)
0049 add_gpg_crypto_test(cryptohelpertest core-cryptohelpertest)
0050 target_link_libraries(cryptohelpertest PUBLIC
0051 Qt::Test
0052 KPim6::MimeTreeParserCore
0053 )
0054
0055 add_executable(mimetreeparsertest mimetreeparsertest.cpp)
0056 add_gpg_crypto_test(mimetreeparsertest core-mimetreeparsertest)
0057 target_link_libraries(mimetreeparsertest PUBLIC
0058 Qt::Test
0059 KPim6::MimeTreeParserCore
0060 Gpgmepp
0061 )
0062
0063 add_executable(gpgerrortest gpgerrortest.cpp)
0064 target_link_libraries(gpgerrortest PUBLIC
0065 Qt::Test
0066 KPim6::MimeTreeParserCore
0067 Gpgmepp
0068 )
0069 add_test(NAME core-gpgerrortest COMMAND $<TARGET_FILE:gpgerrortest>)
0070
0071 add_executable(fileopenertest fileopenertest.cpp)
0072 target_link_libraries(fileopenertest PUBLIC
0073 Qt::Test
0074 KPim6::MimeTreeParserCore
0075 Gpgmepp
0076 )
0077 add_test(NAME core-fileopenertest COMMAND $<TARGET_FILE:fileopenertest>)
0078
0079 ## PartModel test
0080 add_executable(partmodeltest partmodeltest.cpp)
0081 add_gpg_crypto_test(partmodeltest core-partmodeltest)
0082 target_link_libraries(partmodeltest
0083 Qt::Test
0084 KPim6::MimeTreeParserCore
0085 Gpgmepp
0086 )
0087
0088 ecm_add_test(attachmentmodeltest.cpp
0089 LINK_LIBRARIES KPim6MimeTreeParserCore Qt::Test Gpgmepp
0090 NAME_PREFIX "core-"
0091 )