Commit b1e9126e authored by Arjen Hiemstra's avatar Arjen Hiemstra

Use KSysGuard namespace for KSysGuard library targets

Summary:
Instead of using KF5 which is wrong since KSysGuard isn't part of
frameworks.

This needs a follow up patch to the ksysguard repo to make it use the new
namespace.

For backward compatibility, a KF5SysGuardConfig file is still installed that
aliases the new targets, but mentions they are deprecated.

Test Plan: Still builds

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D29302
parent 82879c59
......@@ -63,7 +63,7 @@ check_library_exists(c clock_gettime "time.h" HAVE_CLOCK_GETTIME_C)
ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX KSYSGUARD
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ksysguard_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5SysGuardConfigVersion.cmake"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KSysGuardConfigVersion.cmake"
SOVERSION 9
)
......@@ -125,20 +125,30 @@ kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
install(DIRECTORY scripts/ DESTINATION ${KDE_INSTALL_DATADIR}/ksysguard/scripts)
set(CMAKECONFIG_INSTALL_DIR ${KDE_INSTALL_LIBDIR}/cmake/KF5SysGuard)
set(CMAKECONFIG_INSTALL_DIR ${KDE_INSTALL_LIBDIR}/cmake/KSysGuard)
configure_package_config_file(KSysGuardConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/KSysGuardConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR})
configure_package_config_file(KF5SysGuardConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/KF5SysGuardConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR})
INSTALL_DESTINATION ${KDE_INSTALL_LIBDIR}/cmake/KF5SysGuard
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/KF5SysGuardConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/KF5SysGuardConfigVersion.cmake
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
${CMAKE_CURRENT_BINARY_DIR}/KSysGuardConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/KSysGuardConfigVersion.cmake
DESTINATION ${CMAKECONFIG_INSTALL_DIR})
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/KF5SysGuardConfig.cmake
DESTINATION ${KDE_INSTALL_LIBDIR}/cmake/KF5SysGuard
)
install(EXPORT libksysguardLibraryTargets
NAMESPACE KF5::
NAMESPACE KSysGuard::
DESTINATION ${CMAKECONFIG_INSTALL_DIR}
FILE KF5SysGuardLibraryTargets.cmake )
FILE KSysGuardLibraryTargets.cmake )
install(FILES libksysguard.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
......
@PACKAGE_INIT@
message(WARNING "The KF5:: namespace for KSysGuard targets is deprecated. Please use KSysGuard as namespace.")
include(CMakeFindDependencyMacro)
find_dependency(Qt5Core @QT_MIN_VERSION@)
find_dependency(Qt5Network @QT_MIN_VERSION@)
find_dependency(Qt5Widgets @QT_MIN_VERSION@)
find_dependency(KSysGuard REQUIRED)
find_dependency(KF5Config @KF5_MIN_VERSION@)
find_dependency(KF5I18n @KF5_MIN_VERSION@)
find_dependency(KF5IconThemes @KF5_MIN_VERSION@)
macro(add_sysguard_target _target)
set_target_properties(KSysGuard::${_target} PROPERTIES IMPORTED_GLOBAL TRUE)
add_library(KF5::${_target} ALIAS KSysGuard::${_target})
endmacro()
include("${CMAKE_CURRENT_LIST_DIR}/KF5SysGuardLibraryTargets.cmake")
add_sysguard_target(SysGuard)
add_sysguard_target(ProcessCore)
add_sysguard_target(ProcessUi)
add_sysguard_target(LsofUi)
add_sysguard_target(SignalPlotter)
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Qt5Core @QT_MIN_VERSION@)
find_dependency(Qt5Network @QT_MIN_VERSION@)
find_dependency(Qt5Widgets @QT_MIN_VERSION@)
find_dependency(KF5Config @KF5_MIN_VERSION@)
find_dependency(KF5I18n @KF5_MIN_VERSION@)
find_dependency(KF5IconThemes @KF5_MIN_VERSION@)
include("${CMAKE_CURRENT_LIST_DIR}/KSysGuardLibraryTargets.cmake")
......@@ -5,7 +5,7 @@ if(Qt5WebEngineWidgets_FOUND)
# Process unit test
ecm_qt_declare_logging_category(processtest_debug_SRCS HEADER processcore_debug.h IDENTIFIER LIBKSYSGUARD_PROCESSCORE CATEGORY_NAME org.kde.libksysguard.processcore)
ecm_add_test(processtest.cpp ${processtest_debug_SRCS} TEST_NAME processtest
LINK_LIBRARIES KF5::ProcessUi Qt5::Test)
LINK_LIBRARIES KSysGuard::ProcessUi Qt5::Test)
endif()
if (KF5Plasma_FOUND)
......@@ -13,17 +13,17 @@ if (KF5Plasma_FOUND)
ecm_qt_declare_logging_category(SIGNALPLOTTER_DEBUG_SRCS HEADER ksignalplotter_debug.h IDENTIFIER LIBKSYSGUARD_KSIGNALPLOTTER CATEGORY_NAME org.kde.libksysguard.ksignalplotter)
ecm_add_test(signalplotterbenchmark.cpp ../signalplotter/ksignalplotter.cpp ${SIGNALPLOTTER_DEBUG_SRCS}
TEST_NAME signalplotterbenchmark
LINK_LIBRARIES KF5::SignalPlotter Qt5::Test Qt5::Widgets KF5::IconThemes
LINK_LIBRARIES KSysGuard::SignalPlotter Qt5::Test Qt5::Widgets KF5::IconThemes
)
ecm_add_test(graphicssignalplotterbenchmark.cpp ../signalplotter/kgraphicssignalplotter.cpp ${SIGNALPLOTTER_DEBUG_SRCS}
TEST_NAME graphicssignalplotterbenchmark
LINK_LIBRARIES KF5::SignalPlotter Qt5::Test Qt5::Widgets KF5::IconThemes KF5::Plasma
LINK_LIBRARIES KSysGuard::SignalPlotter Qt5::Test Qt5::Widgets KF5::IconThemes KF5::Plasma
)
ecm_add_test(signalplottertest.cpp ../signalplotter/ksignalplotter.cpp ${SIGNALPLOTTER_DEBUG_SRCS}
TEST_NAME signalplottertest
LINK_LIBRARIES KF5::SignalPlotter Qt5::Test Qt5::Widgets KF5::IconThemes
LINK_LIBRARIES KSysGuard::SignalPlotter Qt5::Test Qt5::Widgets KF5::IconThemes
)
endif()
......
......@@ -16,7 +16,7 @@ add_definitions(-DTRANSLATION_DOMAIN=\"ksgrd\")
remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS)
add_library(ksgrd ${ksgrd_LIB_SRCS})
add_library(KF5::SysGuard ALIAS ksgrd)
add_library(KSysGuard::SysGuard ALIAS ksgrd)
target_include_directories(ksgrd
PUBLIC
"$<BUILD_INTERFACE:${libksysguard_SOURCE_DIR}>"
......@@ -31,7 +31,7 @@ target_link_libraries(ksgrd
PRIVATE
KF5::I18n
KF5::CoreAddons
KF5::ProcessCore
KSysGuard::ProcessCore
)
set_target_properties(ksgrd PROPERTIES VERSION ${KSYSGUARD_VERSION_STRING} SOVERSION ${KSYSGUARD_SOVERSION} EXPORT_NAME SysGuard)
......
......@@ -10,7 +10,7 @@ ki18n_wrap_ui( lsofui_LIB_SRCS
)
add_library(lsofui ${lsofui_LIB_SRCS})
add_library(KF5::LsofUi ALIAS lsofui)
add_library(KSysGuard::LsofUi ALIAS lsofui)
target_link_libraries(lsofui
PUBLIC
......
......@@ -19,7 +19,6 @@ set(ksysguard_LIB_SRCS
ecm_qt_declare_logging_category(ksysguard_LIB_SRCS HEADER processcore_debug.h IDENTIFIER LIBKSYSGUARD_PROCESSCORE CATEGORY_NAME org.kde.libksysguard.processcore)
add_library(processcore ${ksysguard_LIB_SRCS})
add_library(KF5::ProcessCore ALIAS processcore)
add_library(KSysGuard::ProcessCore ALIAS processcore)
target_link_libraries(processcore
......
......@@ -23,7 +23,7 @@ ki18n_wrap_ui( processui_LIB_SRCS
)
add_library(processui ${processui_LIB_SRCS})
add_library(KF5::ProcessUi ALIAS processui)
add_library(KSysGuard::ProcessUi ALIAS processui)
if(X11_XRes_FOUND)
target_link_libraries(processui PRIVATE ${X11_XRes_LIB} ${X11_LIBRARIES})
......@@ -32,7 +32,7 @@ endif()
target_link_libraries(processui
PUBLIC
KF5::ProcessCore
KSysGuard::ProcessCore
Qt5::Widgets
KF5::ConfigCore
PRIVATE
......
......@@ -7,7 +7,7 @@ set(ksignalplotter_LIB_SRCS
)
ecm_qt_declare_logging_category(ksignalplotter_LIB_SRCS HEADER ksignalplotter_debug.h IDENTIFIER LIBKSYSGUARD_KSIGNALPLOTTER CATEGORY_NAME org.kde.libksysguard.ksignalplotter)
add_library(ksignalplotter ${ksignalplotter_LIB_SRCS})
add_library(KF5::SignalPlotter ALIAS ksignalplotter)
add_library(KSysGuard::SignalPlotter ALIAS ksignalplotter)
target_link_libraries(ksignalplotter
PUBLIC
......@@ -15,7 +15,7 @@ target_link_libraries(ksignalplotter
KF5::I18n # klocalizedstring.h
KF5::IconThemes
PRIVATE
KF5::ProcessCore
KSysGuard::ProcessCore
KF5::Plasma
)
......
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