From 3f29f3d6452f735757cb8f84dfc20cdcba791613 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sun, 7 Nov 2021 21:34:18 +0100 Subject: Copy ConfigPropertyMap from KDeclarative to new KConfig QML module This way consumers which want to use the ConfigPropertyMap don't have to pull in KDeclarative's entire dependency tree. Also we can remove the automatic saving of the config, previously this was opt-out - which makes is difficult to deprecate anything. This way the API design is also more clear, since the object only takes care of exposing the data to QML. The writing has to be done manually, which makes more sense anyways when we have the notify opt-in. As discussed on the KF6 weekly thread, an optional QML submodule is seen as the best way to handle the QML dependency. Task: https://phabricator.kde.org/T12131 Relates to https://phabricator.kde.org/T12126, after his change the KDeclarative stuff can be deprecated. Because we don't register the property map in any QML plugin, there is no conflict in duplicating and modifying it now. --- src/qml/CMakeLists.txt | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/qml/CMakeLists.txt (limited to 'src/qml/CMakeLists.txt') diff --git a/src/qml/CMakeLists.txt b/src/qml/CMakeLists.txt new file mode 100644 index 00000000..1cdae88a --- /dev/null +++ b/src/qml/CMakeLists.txt @@ -0,0 +1,39 @@ +add_library(KF5ConfigQml) +add_library(KF5::ConfigQml ALIAS KF5ConfigQml) + +target_sources(KF5ConfigQml PRIVATE + kconfigpropertymap.cpp +) + +ecm_generate_export_header(KF5ConfigQml + BASE_NAME KConfigQml + GROUP_BASE_NAME KF + VERSION ${KF_VERSION} + DEPRECATED_BASE_VERSION 0 + EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} +) + +target_link_libraries(KF5ConfigQml + PUBLIC + KF5::ConfigCore # KCoreConfigSkeleton, in ConfigPropertyMap + Qt5::Qml +) +set_target_properties(KF5ConfigQml PROPERTIES VERSION ${KCONFIG_VERSION} + SOVERSION ${KCONFIG_SOVERSION} + EXPORT_NAME ConfigQml +) + +ecm_generate_headers(KConfigQml_HEADERS + HEADER_NAMES + KConfigPropertyMap + + REQUIRED_HEADERS KConfigQml_HEADERS +) +target_include_directories(KF5ConfigQml INTERFACE "$") + +install(TARGETS KF5ConfigQml EXPORT KF5ConfigTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/kconfigqml_export.h + ${KConfigQml_HEADERS} + DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KConfigQml COMPONENT Devel +) -- cgit v1.2.1