diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,11 +10,12 @@ ecm_qt_declare_logging_category(kauthdebug_SRCS HEADER kauthdebug.h IDENTIFIER KAUTH CATEGORY_NAME kf5.kauth) if(TARGET Qt5::Widgets) - set(libkauth_SRCS + # TODO KF6 Make this lib be the main one and the Widgets one the one with a different name + # TODO Also this would be installable if no widgets available, just needs more work + set(libkauth_no_widgets_SRCS kauthaction.cpp kauthactionreply.cpp kauthexecutejob.cpp - kauthobjectdecorator.cpp AuthBackend.cpp BackendsManager.cpp HelperProxy.cpp @@ -25,14 +26,30 @@ ${KAuth_QM_LOADER} ) + add_library(KF5AuthNoWidgets ${libkauth_no_widgets_SRCS}) + target_link_libraries(KF5AuthNoWidgets PUBLIC Qt5::Core KF5::CoreAddons) # for KJob + target_link_libraries(KF5AuthNoWidgets PRIVATE Qt5::DBus) + target_include_directories(KF5AuthNoWidgets INTERFACE "$") + install(TARGETS KF5AuthNoWidgets EXPORT KF5AuthTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) + set_target_properties(KF5AuthNoWidgets PROPERTIES VERSION ${KAUTH_VERSION_STRING} + SOVERSION ${KAUTH_SOVERSION} + EXPORT_NAME AuthNoWidgets) + + set(kauthwidgetdebug_SRCS) + ecm_qt_declare_logging_category(kauthwidgetdebug_SRCS HEADER kauthwidgetdebug.h IDENTIFIER KAUTHWIDGET CATEGORY_NAME kf5.kauthwidget) + set(libkauth_SRCS + ${kauthwidgetdebug_SRCS} + kauthobjectdecorator.cpp + ) + add_library(KF5Auth ${libkauth_SRCS}) generate_export_header(KF5Auth BASE_NAME KAuth) add_library(KF5::Auth ALIAS KF5Auth) target_include_directories(KF5Auth INTERFACE "$") - target_link_libraries(KF5Auth PUBLIC Qt5::Core KF5::CoreAddons) # for KJob - target_link_libraries(KF5Auth PRIVATE Qt5::Widgets Qt5::DBus) + target_link_libraries(KF5Auth PUBLIC KF5AuthNoWidgets) + target_link_libraries(KF5Auth PRIVATE Qt5::Widgets) set_target_properties(KF5Auth PROPERTIES VERSION ${KAUTH_VERSION_STRING} SOVERSION ${KAUTH_SOVERSION} EXPORT_NAME Auth diff --git a/src/kauthobjectdecorator.cpp b/src/kauthobjectdecorator.cpp --- a/src/kauthobjectdecorator.cpp +++ b/src/kauthobjectdecorator.cpp @@ -21,7 +21,7 @@ #include "kauthaction.h" #include "kauthexecutejob.h" -#include "kauthdebug.h" +#include "kauthwidgetdebug.h" #include #include @@ -66,7 +66,7 @@ return; } - qCWarning(KAUTH) << Q_FUNC_INFO << "We're not decorating an action or a button"; + qCWarning(KAUTHWIDGET) << Q_FUNC_INFO << "We're not decorating an action or a button"; } void ObjectDecoratorPrivate::linkActionToWidget() @@ -83,7 +83,7 @@ return; } - qCWarning(KAUTH) << Q_FUNC_INFO << "We're not decorating an action or a widget"; + qCWarning(KAUTHWIDGET) << Q_FUNC_INFO << "We're not decorating an action or a widget"; } void ObjectDecoratorPrivate::slotActivated()