Commit 8e90710e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use more target-centric cmake code

parent eeb62b12
Pipeline #62847 passed with stage
in 16 minutes and 36 seconds
......@@ -7,8 +7,10 @@ if(BUILD_TESTING)
add_definitions(-DBUILD_TESTING)
endif(BUILD_TESTING)
add_library(KF5KSieve)
add_library(KF5::KSieve ALIAS KF5KSieve)
set(libksieve_parser_SRCS
target_sources(KF5KSieve PRIVATE
parser/utf8validator.cpp
parser/lexer.cpp
parser/parser.cpp
......@@ -16,23 +18,19 @@ set(libksieve_parser_SRCS
add_definitions(-DTRANSLATION_DOMAIN=\"libksieve\")
add_subdirectory(kmanagesieve)
add_subdirectory(ksieveui)
########### next target ###############
set(ksieve_LIB_SRCS
target_sources(KF5KSieve PRIVATE
shared/error.cpp
${libksieve_parser_SRCS}
)
add_library(KF5KSieve ${ksieve_LIB_SRCS})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5KSieve PROPERTIES UNITY_BUILD ON)
endif()
generate_export_header(KF5KSieve BASE_NAME ksieve)
add_library(KF5::KSieve ALIAS KF5KSieve)
target_link_libraries(KF5KSieve
PRIVATE
......@@ -54,6 +52,9 @@ ecm_generate_pri_file(BASE_NAME KSieve
DEPS "" FILENAME_VAR PRI_FILENAME
)
add_subdirectory(kmanagesieve)
add_subdirectory(ksieveui)
install(TARGETS KF5KSieve EXPORT KF5KSieveTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES
......
set(kmanagesieve_LIB_SRCS
add_library(KF5KManageSieve)
add_library(KF5::KManageSieve ALIAS KF5KManageSieve)
target_sources(KF5KManageSieve PRIVATE
response.cpp
session.cpp
sessionthread.cpp
sievejob.cpp
)
ecm_qt_declare_logging_category(kmanagesieve_LIB_SRCS HEADER kmanagersieve_debug.h IDENTIFIER KMANAGERSIEVE_LOG CATEGORY_NAME org.kde.pim.kmanagersieve
ecm_qt_declare_logging_category(KF5KManageSieve HEADER kmanagersieve_debug.h IDENTIFIER KMANAGERSIEVE_LOG CATEGORY_NAME org.kde.pim.kmanagersieve
DESCRIPTION "kdepim (libksieve manager)"
OLD_CATEGORY_NAMES log_kmanagersieve
EXPORT LIBKSIEVE
)
add_library(KF5KManageSieve ${kmanagesieve_LIB_SRCS})
generate_export_header(KF5KManageSieve BASE_NAME kmanagesieve)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5KManageSieve PROPERTIES UNITY_BUILD ON)
endif()
add_library(KF5::KManageSieve ALIAS KF5KManageSieve)
if (WIN32)
set(extra_LIBS ws2_32)
......
add_library(KF5KSieveUi)
add_library(KF5::KSieveUi ALIAS KF5KSieveUi)
if(KDEPIM_ENTERPRISE_BUILD)
set(USE_GRAPHICAL_SIEVE_EDITOR true)
else()
......@@ -25,7 +27,7 @@ if(BUILD_TESTING)
add_subdirectory(widgets/autotests)
endif()
set(ksieveui_vacation_LIB_SRCS
target_sources(KF5KSieveUi PRIVATE
vacation/vacationmaillineedit.cpp
vacation/vacationhelperjob.cpp
vacation/vacationeditwidget.cpp
......@@ -43,7 +45,7 @@ set(ksieveui_vacation_LIB_SRCS
vacation/legacy/vacationscriptextractor.cpp
vacation/searchserverwithvacationsupportjob.cpp
)
set(ksieveui_webpageeditor_LIB_SRCS
target_sources(KF5KSieveUi PRIVATE
editor/webengine/sieveeditorwebengineview.cpp
editor/webengine/sieveeditorhelphtmlwidget.cpp
editor/webengine/sieveeditorloadprogressindicator.cpp
......@@ -51,8 +53,7 @@ set(ksieveui_webpageeditor_LIB_SRCS
editor/webengine/findbar/findbarwebengineview.cpp
)
set(ksieveui_editor_LIB_SRCS
${ksieveui_webpageeditor_LIB_SRCS}
target_sources(KF5KSieveUi PRIVATE
editor/sieveeditorwidget.cpp
editor/sievetextedit.cpp
editor/sieveeditor.cpp
......@@ -71,7 +72,7 @@ set(ksieveui_editor_LIB_SRCS
editor/sieveinfodialog.cpp
)
set(ksieveui_autocreatescripts_LIB_SRCS
target_sources(KF5KSieveUi PRIVATE
autocreatescripts/sievepreviewgeneratedcodewidget.cpp
autocreatescripts/sieveeditorgraphicalmodewidgetabstract.cpp
autocreatescripts/sievescriptparsingerrordialog.cpp
......@@ -162,13 +163,13 @@ set(ksieveui_autocreatescripts_LIB_SRCS
autocreatescripts/sieveconditions/widgets/regexpeditorlineedit.cpp
)
set(ksieveui_scriptsparsing_LIB_SRCS
target_sources(KF5KSieveUi PRIVATE
scriptsparsing/xmlprintingscriptbuilder.cpp
scriptsparsing/parsingresultdialog.cpp
scriptsparsing/parsingutil.cpp
)
set(ksieveui_sievescriptdebugger_LIB_SRCS
target_sources(KF5KSieveUi PRIVATE
sievescriptdebugger/sievescriptdebuggerdialog.cpp
sievescriptdebugger/sievescriptdebuggerwidget.cpp
sievescriptdebugger/sievescriptdebuggerfrontendwidget.cpp
......@@ -177,20 +178,20 @@ set(ksieveui_sievescriptdebugger_LIB_SRCS
sievescriptdebugger/sievescriptdebuggerresulteditor.cpp
)
set(ksieveui_managescriptjob_LIB_SRCS
target_sources(KF5KSieveUi PRIVATE
managescriptsjob/checkkolabkep14supportjob.cpp
managescriptsjob/generateglobalscriptjob.cpp
managescriptsjob/parseuserscriptjob.cpp
managescriptsjob/renamescriptjob.cpp
managescriptsjob/checkscriptjob.cpp
)
set(ksieveui_sieveimapinstance_LIB_SRCS
target_sources(KF5KSieveUi PRIVATE
sieveimapinstance/sieveimapinstance.cpp
sieveimapinstance/sieveimapinstanceinterface.cpp
sieveimapinstance/sieveimapinstanceinterfacemanager.cpp
)
set(ksieveui_sieveutil_LIB_SRCS
target_sources(KF5KSieveUi PRIVATE
util/util.cpp
util/abstractakonadiimapsettinginterface.cpp
util/akonadiimapsettinginterface.cpp
......@@ -199,7 +200,7 @@ set(ksieveui_sieveutil_LIB_SRCS
util/sieveimappasswordprovider.cpp
)
set(ksieveui_widgets_SRCS
target_sources(KF5KSieveUi PRIVATE
widgets/custommanagesievewidget.cpp
widgets/sievetreewidgetitem.cpp
widgets/managesievetreeview.cpp
......@@ -212,39 +213,29 @@ set(ksieveui_widgets_SRCS
widgets/moveimapfolderwidget.cpp
)
set(ksieveui_LIB_SRCS
target_sources(KF5KSieveUi PRIVATE
managesievescriptsdialog.cpp
debug/sievedebugdialog.cpp
templates/sievetemplatewidget.cpp
templates/sievedefaulttemplate.cpp
templates/sievetemplateeditdialog.cpp
${ksieveui_widgets_SRCS}
${ksieveui_sieveutil_LIB_SRCS}
${ksieveui_sieveimapinstance_LIB_SRCS}
${ksieveui_scriptsparsing_LIB_SRCS}
${ksieveui_vacation_LIB_SRCS}
${ksieveui_editor_LIB_SRCS}
${ksieveui_autocreatescripts_LIB_SRCS}
${ksieveui_sievescriptdebugger_LIB_SRCS}
${ksieveui_managescriptjob_LIB_SRCS}
)
ecm_qt_declare_logging_category(ksieveui_LIB_SRCS HEADER libksieve_debug.h IDENTIFIER LIBKSIEVE_LOG CATEGORY_NAME org.kde.pim.libksieve
ecm_qt_declare_logging_category(KF5KSieveUi HEADER libksieve_debug.h IDENTIFIER LIBKSIEVE_LOG CATEGORY_NAME org.kde.pim.libksieve
DESCRIPTION "kdepim (libksieve)"
OLD_CATEGORY_NAMES log_libksieve
EXPORT LIBKSIEVE
)
kconfig_add_kcfg_files(ksieveui_LIB_SRCS settings/sieve-vacation.kcfgc settings/sieve-editor.kcfgc)
kconfig_add_kcfg_files(KF5KSieveUi settings/sieve-vacation.kcfgc settings/sieve-editor.kcfgc)
add_library(KF5KSieveUi ${ksieveui_LIB_SRCS})
generate_export_header(KF5KSieveUi BASE_NAME ksieveui)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KF5KSieveUi PROPERTIES UNITY_BUILD ON)
endif()
add_library(KF5::KSieveUi ALIAS KF5KSieveUi)
target_link_libraries(KF5KSieveUi
PUBLIC
......
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