Use more target-centric cmake code

NO_CHANGELOG
This commit is contained in:
Friedrich W. H. Kossebau 2021-05-17 18:43:37 +02:00
parent 5a5ce88faa
commit 2c23dc0123
16 changed files with 62 additions and 85 deletions

View File

@ -1,10 +1,10 @@
set(customDataContainers_SRCS
add_library(plasma_dataengine_example_customDataContainers MODULE)
target_sources(plasma_dataengine_example_customDataContainers PRIVATE
customDataContainersEngine.cpp
httpContainer.cpp
)
add_library(plasma_dataengine_example_customDataContainers MODULE ${customDataContainers_SRCS})
kcoreaddons_desktop_to_json(plasma_dataengine_example_customDataContainers plasma-dataengine-example-customDataContainers.desktop)
target_link_libraries(plasma_dataengine_example_customDataContainers

View File

@ -1,8 +1,4 @@
set(simpleEngine_SRCS
simpleEngine.cpp
)
add_library(plasma_dataengine_example_simpleEngine MODULE ${simpleEngine_SRCS})
add_library(plasma_dataengine_example_simpleEngine MODULE simpleEngine.cpp)
kcoreaddons_desktop_to_json(plasma_dataengine_example_simpleEngine plasma-dataengine-example-simpleEngine.desktop)

View File

@ -1,8 +1,4 @@
set(sourcesOnRequest_SRCS
sourcesOnRequest.cpp
)
add_library(plasma_dataengine_example_sourcesOnRequest MODULE ${sourcesOnRequest_SRCS})
add_library(plasma_dataengine_example_sourcesOnRequest MODULE sourcesOnRequest.cpp)
kcoreaddons_desktop_to_json(plasma_dataengine_example_sourcesOnRequest plasma-dataengine-example-sourcesOnRequest.desktop)

View File

@ -1,12 +1,11 @@
set(exampleplasmashell-app_SRCS
add_executable(exampleplasmashell)
target_sources(exampleplasmashell PRIVATE
customcorona.cpp
main.cpp
)
add_executable(exampleplasmashell ${exampleplasmashell-app_SRCS})
target_link_libraries(
exampleplasmashell
target_link_libraries(exampleplasmashell
Qt5::Widgets
Qt5::Quick
Qt5::Qml

View File

@ -1,9 +1,6 @@
set(test_SRCS
test.cpp
)
ki18n_wrap_ui(test_SRCS config.ui)
add_library(plasma_containmentactions_test MODULE test.cpp)
ki18n_wrap_ui(plasma_containmentactions_test config.ui)
add_library(plasma_containmentactions_test MODULE ${test_SRCS})
target_link_libraries(plasma_containmentactions_test KF5::Plasma KF5::I18n KF5::KIOWidgets KF5::XmlGui)
install(TARGETS plasma_containmentactions_test DESTINATION ${KDE_INSTALL_PLUGINDIR})

View File

@ -1,4 +1,6 @@
set(calendar_SRCS
add_library(calendarplugin SHARED)
target_sources(calendarplugin PRIVATE
calendarplugin.cpp
#incidencemodifier.cpp
calendar.cpp
@ -11,8 +13,6 @@ set(calendar_SRCS
eventpluginsmanager.cpp
)
add_library(calendarplugin SHARED ${calendar_SRCS})
target_link_libraries(calendarplugin
Qt5::Core
Qt5::Quick

View File

@ -6,7 +6,9 @@ endif()
configure_file(config-x11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-x11.h)
set(corebindings_SRCS
add_library(corebindingsplugin SHARED)
target_sources(corebindingsplugin PRIVATE
corebindingsplugin.cpp
colorscope.cpp
datamodel.cpp
@ -22,11 +24,10 @@ set(corebindings_SRCS
iconitem.cpp
units.cpp
windowthumbnail.cpp
)
qt_add_resources(corebindings_SRCS shaders.qrc)
shaders.qrc
)
add_library(corebindingsplugin SHARED ${corebindings_SRCS})
target_link_libraries(corebindingsplugin
Qt5::Quick
Qt5::Qml

View File

@ -1,6 +1,8 @@
#find_package(KF5Declarative REQUIRED NO_MODULE)
set(plasmacomponents_SRCS
add_library(plasmacomponentsplugin SHARED)
target_sources(plasmacomponentsplugin PRIVATE
#fullscreensheet.cpp
#fullscreenwindow.cpp
plasmacomponentsplugin.cpp
@ -10,7 +12,6 @@ set(plasmacomponents_SRCS
qmenuitem.cpp
)
add_library(plasmacomponentsplugin SHARED ${plasmacomponents_SRCS})
target_link_libraries(plasmacomponentsplugin
Qt5::Core
Qt5::Quick

View File

@ -4,14 +4,13 @@
# TYPE REQUIRED
# PURPOSE "Provides the ability to access activities from QML."
# )
add_library(plasmaextracomponentsplugin SHARED)
set(plasmaextracomponents_SRCS
target_sources(plasmaextracomponentsplugin PRIVATE
appbackgroundprovider.cpp
plasmaextracomponentsplugin.cpp
fallbackcomponent.cpp
)
add_library(plasmaextracomponentsplugin SHARED ${plasmaextracomponents_SRCS})
)
target_link_libraries(plasmaextracomponentsplugin
Qt5::Quick

View File

@ -1,16 +1,15 @@
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(platformcomponents_SRCS
add_library(platformcomponentsplugin SHARED)
target_sources(platformcomponentsplugin PRIVATE
platformextensionplugin.cpp
application.cpp
icondialog.cpp
)
)
add_library(platformcomponentsplugin SHARED ${platformcomponents_SRCS})
target_link_libraries(
platformcomponentsplugin
target_link_libraries(platformcomponentsplugin
Qt5::Core
Qt5::DBus
Qt5::Qml

View File

@ -6,9 +6,16 @@ endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-plasma.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-plasma.h)
########### next target ###############
add_library(KF5Plasma)
add_library(KF5::Plasma ALIAS KF5Plasma)
set(Plasma_LIB_SRCS
set_target_properties(KF5Plasma PROPERTIES
VERSION ${PLASMA_VERSION}
SOVERSION ${PLASMA_SOVERSION}
EXPORT_NAME Plasma
)
target_sources(KF5Plasma PRIVATE
#global
plasma.cpp
pluginloader.cpp
@ -50,17 +57,17 @@ set(Plasma_LIB_SRCS
if(NOT EXCLUDE_DEPRECATED_BEFORE_AND_AT STREQUAL "CURRENT" AND
EXCLUDE_DEPRECATED_BEFORE_AND_AT VERSION_LESS 5.83.0)
#packages
set(Plasma_LIB_SRCS ${Plasma_LIB_SRCS} package.cpp packagestructure.cpp)
target_sources(KF5Plasma PRIVATE package.cpp packagestructure.cpp)
endif()
if(HAVE_X11)
set(Plasma_LIB_SRCS ${Plasma_LIB_SRCS} private/effectwatcher.cpp)
target_sources(KF5Plasma PRIVATE private/effectwatcher.cpp)
endif()
kconfig_add_kcfg_files(Plasma_LIB_SRCS data/kconfigxt/libplasma-theme-global.kcfgc)
kconfig_add_kcfg_files(KF5Plasma data/kconfigxt/libplasma-theme-global.kcfgc)
ecm_qt_declare_logging_category(Plasma_LIB_SRCS
ecm_qt_declare_logging_category(KF5Plasma
HEADER debug_p.h
IDENTIFIER LOG_PLASMA
CATEGORY_NAME kf.plasma.core
@ -69,8 +76,6 @@ ecm_qt_declare_logging_category(Plasma_LIB_SRCS
EXPORT PLASMA
)
add_library(KF5Plasma ${Plasma_LIB_SRCS})
add_library(KF5::Plasma ALIAS KF5Plasma)
ecm_generate_export_header(KF5Plasma
EXPORT_FILE_NAME plasma/plasma_export.h
BASE_NAME Plasma
@ -120,12 +125,6 @@ target_include_directories(KF5Plasma INTERFACE
"$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5};${KDE_INSTALL_INCLUDEDIR_KF5}/Plasma>"
)
set_target_properties(KF5Plasma PROPERTIES
VERSION ${PLASMA_VERSION}
SOVERSION ${PLASMA_SOVERSION}
EXPORT_NAME Plasma
)
########### install files ###############
ecm_generate_headers(Plasma_CamelCase_HEADERS
HEADER_NAMES

View File

@ -4,7 +4,16 @@ else()
add_definitions(-DHAVE_XCB_SHAPE=0)
endif()
set(plasmaquick_LIB_SRC
add_library(KF5PlasmaQuick SHARED)
add_library(KF5::PlasmaQuick ALIAS KF5PlasmaQuick)
set_target_properties(KF5PlasmaQuick PROPERTIES
VERSION ${PLASMA_VERSION}
SOVERSION ${PLASMA_SOVERSION}
EXPORT_NAME PlasmaQuick
)
target_sources(KF5PlasmaQuick PRIVATE
appletquickitem.cpp
debug_p.cpp
dialog.cpp
@ -21,10 +30,10 @@ set(plasmaquick_LIB_SRC
)
if(HAVE_KWAYLAND)
set(plasmaquick_LIB_SRC ${plasmaquick_LIB_SRC} waylandintegration.cpp)
target_sources(KF5PlasmaQuick PRIVATE waylandintegration.cpp)
endif()
ecm_qt_declare_logging_category(PlasmaQuick_LIB_SRCS
ecm_qt_declare_logging_category(KF5PlasmaQuick
HEADER debug_p.h
IDENTIFIER LOG_PLASMAQUICK
CATEGORY_NAME kf.plasma.quick
@ -33,8 +42,6 @@ ecm_qt_declare_logging_category(PlasmaQuick_LIB_SRCS
EXPORT PLASMA
)
add_library(KF5PlasmaQuick SHARED ${plasmaquick_LIB_SRC})
add_library(KF5::PlasmaQuick ALIAS KF5PlasmaQuick)
target_include_directories(KF5PlasmaQuick PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_BINARY_DIR}/..>")
target_link_libraries(KF5PlasmaQuick
@ -75,12 +82,6 @@ if(HAVE_X11)
endif()
endif()
set_target_properties(KF5PlasmaQuick PROPERTIES
VERSION ${PLASMA_VERSION}
SOVERSION ${PLASMA_SOVERSION}
EXPORT_NAME PlasmaQuick
)
install(TARGETS KF5PlasmaQuick EXPORT KF5PlasmaQuickTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
ecm_generate_export_header(KF5PlasmaQuick

View File

@ -6,15 +6,16 @@ if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
endif()
#DECLARATIVE APPLET
set(declarative_appletscript_SRCS
add_library(plasma_appletscript_declarative MODULE)
target_sources(plasma_appletscript_declarative PRIVATE
plasmoid/declarativeappletscript.cpp
plasmoid/dropmenu.cpp
plasmoid/appletinterface.cpp
plasmoid/containmentinterface.cpp
plasmoid/wallpaperinterface.cpp
)
)
add_library(plasma_appletscript_declarative MODULE ${declarative_appletscript_SRCS} )
set_target_properties(plasma_appletscript_declarative PROPERTIES PREFIX "")
kcoreaddons_desktop_to_json(

View File

@ -1,11 +1,7 @@
# TODO: adapt "org.kde.plasma" here & elsewhere if needed (see README)
add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.%{APPNAMELC}\")
set(%{APPNAMELC}_SRCS
%{APPNAMELC}.cpp
)
add_library(plasma_applet_%{APPNAMELC} MODULE ${%{APPNAMELC}_SRCS})
add_library(plasma_applet_%{APPNAMELC} MODULE %{APPNAMELC}.cpp)
kcoreaddons_desktop_to_json(plasma_applet_%{APPNAMELC} package/metadata.desktop SERVICE_TYPES plasma-applet.desktop)

View File

@ -1,10 +1,6 @@
add_definitions(-DTRANSLATION_DOMAIN=\"plasma_wallpaper_org.kde.plasma.%{APPNAMELC}\")
set(%{APPNAMELC}plugin_SRCS
%{APPNAMELC}plugin.cpp
)
add_library(%{APPNAMELC}plugin SHARED ${%{APPNAMELC}plugin_SRCS})
add_library(%{APPNAMELC}plugin SHARED %{APPNAMELC}plugin.cpp)
target_link_libraries(%{APPNAMELC}plugin
KF5::I18n

View File

@ -1,10 +1,6 @@
add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.%{APPNAMELC}\")
set(%{APPNAMELC}plugin_SRCS
%{APPNAMELC}plugin.cpp
)
add_library(%{APPNAMELC}plugin SHARED ${%{APPNAMELC}plugin_SRCS})
add_library(%{APPNAMELC}plugin SHARED %{APPNAMELC}plugin.cpp)
target_link_libraries(%{APPNAMELC}plugin
KF5::I18n