diff options
author | Alexander Lohnau <alexander.lohnau@gmx.de> | 2021-11-07 21:34:18 +0100 |
---|---|---|
committer | Alexander Lohnau <alexander.lohnau@gmx.de> | 2021-11-22 09:36:02 +0000 |
commit | 3f29f3d6452f735757cb8f84dfc20cdcba791613 (patch) | |
tree | 11f40ed6a40cc3368fedfea193f4994c3447348b /src/qml/CMakeLists.txt | |
parent | c3be6d02f6c061707c6d93e06889a2e56b994d87 (diff) | |
download | kconfig-3f29f3d6452f735757cb8f84dfc20cdcba791613.tar.gz kconfig-3f29f3d6452f735757cb8f84dfc20cdcba791613.tar.bz2 |
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.
Diffstat (limited to 'src/qml/CMakeLists.txt')
-rw-r--r-- | src/qml/CMakeLists.txt | 39 |
1 files changed, 39 insertions, 0 deletions
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_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/KConfigQml>") + +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 +) |