Skip to content

Commit

Permalink
Avoid duplicated CMake code to determine KF version for KIO plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Nov 21, 2023
1 parent e0bdc7e commit fe20167
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions fileitemactionplugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,11 @@ set(KF_PACKAGE_PREFIX
CACHE STRING "specifies the prefix for KDE Frameworks packages")
set(KIO_MODULE_TARGETS "${KF_PACKAGE_PREFIX}::KIOCore" "${KF_PACKAGE_PREFIX}::KIOFileWidgets"
"${KF_PACKAGE_PREFIX}::KIOWidgets")
if (KF_PACKAGE_PREFIX MATCHES ".*KF([0-9]+).*")
set(KF_VERSION ${CMAKE_MATCH_1})
if (KF_VERSION GREATER_EQUAL 6)
list(APPEND KIO_MODULE_TARGETS)
set(META_PLUGIN_CATEGORY kf${KF_VERSION}/kfileitemaction)
else ()
list(APPEND KIO_MODULE_TARGETS "${KF_PACKAGE_PREFIX}::KIONTLM")
endif ()
if (KF_MAJOR_VERSION GREATER_EQUAL 6)
list(APPEND KIO_MODULE_TARGETS)
set(META_PLUGIN_CATEGORY kf${KF_VERSION}/kfileitemaction)
else ()
list(APPEND KIO_MODULE_TARGETS "${KF_PACKAGE_PREFIX}::KIONTLM")
endif ()

# include modules to apply configuration
Expand Down

0 comments on commit fe20167

Please sign in to comment.