Commit b2d99d74 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use more target-centric cmake code

parent ee5faf3b
Pipeline #63172 passed with stage
in 15 minutes and 27 seconds
kde_enable_exceptions()
set(akonadi_search_plugin_SRCS searchplugin.cpp)
ecm_qt_declare_logging_category(akonadi_search_plugin_SRCS HEADER akonadiplugin_indexer_debug.h IDENTIFIER AKONADIPLUGIN_INDEXER_LOG CATEGORY_NAME org.kde.pim.akonadiplugin_indexer
add_library(akonadi_search_plugin
MODULE
)
target_sources(akonadi_search_plugin PRIVATE searchplugin.cpp)
ecm_qt_declare_logging_category(akonadi_search_plugin HEADER akonadiplugin_indexer_debug.h IDENTIFIER AKONADIPLUGIN_INDEXER_LOG CATEGORY_NAME org.kde.pim.akonadiplugin_indexer
DESCRIPTION "akonadisearch (akonadi plugin indexer)"
OLD_CATEGORY_NAMES log_akonadiplugin_indexer
EXPORT AKONADISEARCH
)
add_library(akonadi_search_plugin
MODULE
${akonadi_search_plugin_SRCS}
)
target_link_libraries(akonadi_search_plugin
KF5::AkonadiCore
......
......@@ -8,8 +8,9 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../../agent/
${CMAKE_CURRENT_BINARY_DIR}/..
)
add_executable( searchplugintest)
set(searchplugintest_SRCS
target_sources(searchplugintest PRIVATE
searchplugintest.cpp
../searchplugin.cpp
../../agent/emailindexer.cpp
......@@ -29,7 +30,6 @@ set(searchplugintest_SRCS
add_definitions(-DAKONADI_SEARCH_NO_PLUGINS=TRUE)
add_executable( searchplugintest ${searchplugintest_SRCS} )
add_test( NAME searchplugintest COMMAND searchplugintest )
ecm_mark_as_test(searchplugintest)
......
kde_enable_exceptions()
set(CORE_SRCS
add_library(KF5AkonadiSearchCore)
add_library(KF5::AkonadiSearchCore ALIAS KF5AkonadiSearchCore)
target_sources(KF5AkonadiSearchCore PRIVATE
searchstore.cpp
term.cpp
query.cpp
resultiterator.cpp
)
ecm_qt_declare_logging_category(CORE_SRCS HEADER akonadi_search_core_debug.h IDENTIFIER AKONADI_SEARCH_CORE_LOG CATEGORY_NAME org.kde.pim.akonadi_search_core
ecm_qt_declare_logging_category(KF5AkonadiSearchCore HEADER akonadi_search_core_debug.h IDENTIFIER AKONADI_SEARCH_CORE_LOG CATEGORY_NAME org.kde.pim.akonadi_search_core
DESCRIPTION "akonadisearch (akonadi core lib)"
EXPORT AKONADISEARCH
)
add_library(KF5AkonadiSearchCore ${CORE_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5AkonadiSearchCore PROPERTIES UNITY_BUILD ON)
endif()
add_library(KF5::AkonadiSearchCore ALIAS KF5AkonadiSearchCore)
target_link_libraries(KF5AkonadiSearchCore
PUBLIC
......
add_library(KF5AkonadiSearchDebug)
add_library(KF5::AkonadiSearchDebug ALIAS KF5AkonadiSearchDebug)
set(akonadisearchdebug_SRCS
target_sources(KF5AkonadiSearchDebug PRIVATE
akonadisearchdebugdialog.cpp
akonadisearchdebugwidget.cpp
job/akonadisearchdebugsearchjob.cpp
......@@ -8,12 +10,10 @@ set(akonadisearchdebug_SRCS
)
add_library(KF5AkonadiSearchDebug ${akonadisearchdebug_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5AkonadiSearchDebug PROPERTIES UNITY_BUILD ON)
endif()
add_library(KF5::AkonadiSearchDebug ALIAS KF5AkonadiSearchDebug)
generate_export_header(KF5AkonadiSearchDebug BASE_NAME AKONADI_SEARCH_DEBUG EXPORT_FILE_NAME search_debug_export.h)
......
......@@ -3,7 +3,11 @@ include_directories(
${XAPIAN_INCLUDE_DIR}
)
set(AKONADI_SEARCH_PIM_LIB_SRCS
add_library(KF5AkonadiSearchPIM)
add_library(KF5::AkonadiSearchPIM ALIAS KF5AkonadiSearchPIM)
target_sources(KF5AkonadiSearchPIM PRIVATE
query.cpp
resultiterator.cpp
contactquery.cpp
......@@ -16,19 +20,16 @@ set(AKONADI_SEARCH_PIM_LIB_SRCS
../search/email/agepostingsource.cpp
)
ecm_qt_declare_logging_category(AKONADI_SEARCH_PIM_LIB_SRCS HEADER akonadi_search_pim_debug.h IDENTIFIER AKONADI_SEARCH_PIM_LOG CATEGORY_NAME org.kde.pim.akonadi_search_pim
ecm_qt_declare_logging_category(KF5AkonadiSearchPIM HEADER akonadi_search_pim_debug.h IDENTIFIER AKONADI_SEARCH_PIM_LOG CATEGORY_NAME org.kde.pim.akonadi_search_pim
DESCRIPTION "akonadisearch(akonadi pim lib)"
OLD_CATEGORY_NAMES log_akonadi_search_pim
EXPORT AKONADISEARCH
)
add_library(KF5AkonadiSearchPIM ${AKONADI_SEARCH_PIM_LIB_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5AkonadiSearchPIM PROPERTIES UNITY_BUILD ON)
endif()
add_library(KF5::AkonadiSearchPIM ALIAS KF5AkonadiSearchPIM)
generate_export_header(KF5AkonadiSearchPIM BASE_NAME AKONADI_SEARCH_PIM EXPORT_FILE_NAME search_pim_export.h)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment