From 2940dd75d550270d369bdf41418268d5956060b8 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 8 May 2018 09:37:32 +0200 Subject: Make use of interface include directories and link libraries. Instead of manually specifying the libraries to link against and the include directories to include we'd much rather have a single target to link against. find_package already defines the Gpgme target for some reason, which seems like a waste, but with the lowercase gpgme target we can work around that problem. --- framework/src/CMakeLists.txt | 1 - framework/src/domain/mime/CMakeLists.txt | 2 +- framework/src/domain/mime/mimetreeparser/CMakeLists.txt | 5 +---- framework/src/domain/mime/mimetreeparser/autotests/CMakeLists.txt | 6 +++--- framework/src/domain/mime/mimetreeparser/tests/CMakeLists.txt | 3 +-- 5 files changed, 6 insertions(+), 11 deletions(-) (limited to 'framework/src') diff --git a/framework/src/CMakeLists.txt b/framework/src/CMakeLists.txt index 8ba924fe..d80fe284 100644 --- a/framework/src/CMakeLists.txt +++ b/framework/src/CMakeLists.txt @@ -72,7 +72,6 @@ target_link_libraries(kubeframework KF5::Codecs KF5::Contacts KAsync - ${GPGME_LIBRARIES} ) install(TARGETS kubeframework DESTINATION ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/framework/src/domain/mime/CMakeLists.txt b/framework/src/domain/mime/CMakeLists.txt index 134bf8f0..9b4da136 100644 --- a/framework/src/domain/mime/CMakeLists.txt +++ b/framework/src/domain/mime/CMakeLists.txt @@ -5,5 +5,5 @@ add_library(mailcrypto STATIC target_link_libraries(mailcrypto Qt5::Core KF5::Mime - ${GPGME_LIBRARIES} + gpgme ) diff --git a/framework/src/domain/mime/mimetreeparser/CMakeLists.txt b/framework/src/domain/mime/mimetreeparser/CMakeLists.txt index f9452f3c..e3979a8e 100644 --- a/framework/src/domain/mime/mimetreeparser/CMakeLists.txt +++ b/framework/src/domain/mime/mimetreeparser/CMakeLists.txt @@ -5,9 +5,6 @@ find_package(KF5Mime 4.87.0 CONFIG REQUIRED) find_package(KF5Codecs CONFIG REQUIRED) find_package(Gpgme REQUIRED) -# target_include_directories does not handle empty include paths -include_directories(${GPGME_INCLUDES}) - set(libmimetreeparser_SRCS objecttreeparser.cpp @@ -47,10 +44,10 @@ target_link_libraries(kube_otp target_link_libraries(kube_otp PRIVATE - ${GPGME_LIBRARIES} mailcrypto KF5::Codecs Qt5::Gui + gpgme ) add_subdirectory(autotests) diff --git a/framework/src/domain/mime/mimetreeparser/autotests/CMakeLists.txt b/framework/src/domain/mime/mimetreeparser/autotests/CMakeLists.txt index 55bc4647..7c8e2f3c 100644 --- a/framework/src/domain/mime/mimetreeparser/autotests/CMakeLists.txt +++ b/framework/src/domain/mime/mimetreeparser/autotests/CMakeLists.txt @@ -15,7 +15,7 @@ macro(add_mimetreeparser_unittest _source) ecm_add_test(${_source} util.cpp setupenv.cpp TEST_NAME ${_name} NAME_PREFIX "mimetreeparser-" - LINK_LIBRARIES kube_otp Qt5::Test KF5::Mime ${GPGME_LIBRARIES} + LINK_LIBRARIES kube_otp Qt5::Test KF5::Mime ) endmacro () @@ -24,7 +24,7 @@ macro(add_mimetreeparser_class_unittest _source _additionalSource) ecm_add_test(${_source} ${_additionalSource} TEST_NAME ${_name} NAME_PREFIX "mimetreeparser-" - LINK_LIBRARIES kube_otp Qt5::Test KF5::Mime ${GPGME_LIBRARIES} + LINK_LIBRARIES kube_otp Qt5::Test KF5::Mime ) endmacro () @@ -37,7 +37,7 @@ macro(add_mimetreeparser_crypto_unittest _source) kube_otp Qt5::Test KF5::Mime - ${GPGME_LIBRARIES} + gpgme ) add_gpg_crypto_test(${_name} mimetreeparser-${_name}) endmacro () diff --git a/framework/src/domain/mime/mimetreeparser/tests/CMakeLists.txt b/framework/src/domain/mime/mimetreeparser/tests/CMakeLists.txt index ee52fa2a..b674320c 100644 --- a/framework/src/domain/mime/mimetreeparser/tests/CMakeLists.txt +++ b/framework/src/domain/mime/mimetreeparser/tests/CMakeLists.txt @@ -15,11 +15,10 @@ target_link_libraries(mimetreeparsertest Qt5::Core Qt5::Test KF5::Mime - ${GPGME_LIBRARIES} ) ecm_add_test(gpgerrortest.cpp TEST_NAME "gpgerrortest" NAME_PREFIX "mimetreeparser-" - LINK_LIBRARIES Qt5::Core Qt5::Test kube_otp ${GPGME_LIBRARIES} + LINK_LIBRARIES Qt5::Core Qt5::Test kube_otp gpgme ) -- cgit v1.2.3