Generate all kdebugsettings .categories files automatically

Summary:
Adds two wrapping variants of the macros
declare_qt_logging_category() & install_qt_logging_categories()
which have an argument TYPE to control specific behaviour that
otherwise is generalized in the wrapping macros to not have to repeat
any things with every macro call and to ensure consistency, e.g. in
the used description texts.

The wrapper macros also handle linking things by the matching EXPORT ids,
so the caller does not have to care for this.

No perfect solution yet, but at least a first working approach to automatic
generation of the kdebugsettings files.

Test Plan:
Generated categories files contain same ids with same descriptions as
before.

Reviewers: #kdevelop, kfunk

Reviewed By: #kdevelop, kfunk

Subscribers: kfunk, apol, kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D16032
parent 48e0f084
......@@ -181,7 +181,7 @@ install(FILES
install(EXPORT KDevelopTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" NAMESPACE KDev:: FILE KDevelopTargets.cmake)
# kdebugsettings file
install(FILES kdevelop.categories DESTINATION ${KDE_INSTALL_CONFDIR})
install_qt_logging_categories(TYPE APP_PLUGIN)
# CTestCustom.cmake has to be in the CTEST_BINARY_DIR.
# in the KDE build system, this is the same as CMAKE_BINARY_DIR.
......
......@@ -11,11 +11,11 @@ option(KDEVELOP_SINGLE_APP "Use QtSingleApplication as KDevelop's base" OFF)
set(kdevelop_SRCS main.cpp kdevideextension.cpp)
ecm_qt_declare_logging_category(kdevelop_SRCS
HEADER debug.h
declare_qt_logging_category(kdevelop_SRCS
IDENTIFIER APP
CATEGORY_NAME "kdevelop.app"
TYPE APP
)
qt5_add_resources(kdevelop_SRCS kdevelop.qrc)
#TODO: remove CMAKE_CURRENT_SOURCE_DIR prefix when ECM is fixed
......
......@@ -5,8 +5,10 @@
#
# add_compile_flag_if_supported(<flag> [CXX_ONLY])
# add_target_compile_flag_if_supported(<target> <INTERFACE|PUBLIC|PRIVATE> <flag>)
# declare_qt_logging_category(<sourcevarname> HEADER <filename> IDENTIFIER <id> CATEGORY_NAME <name> EXPORT <target> DESCRIPTION <desc>)
# install_qt_logging_categories(EXPORT <target> FILE <name>)
# declare_qt_logging_category(<sourcevarname>
# TYPE LIBRARY|PLUGIN|APP [IDENTIFIER <id>] [CATEGORY_BASENAME <name>]
# [HEADER <filename>] [DESCRIPTION <desc>])
# install_qt_logging_categories(TYPE LIBRARY|APP_PLUGIN)
#
#=============================================================================
# Copyright 2018 Friedrich W. H. Kossebau <kossebau@kde.org>
......@@ -61,17 +63,20 @@ function(add_target_compile_flag_if_supported _target _scope _flag)
endfunction()
# declare_qt_logging_category(<sourcevarname> HEADER <filename> IDENTIFIER <id> CATEGORY_NAME <name> EXPORT <target> DESCRIPTION <desc>)
# helper method
# _declare_qt_logging_category(<sourcevarname>
# HEADER <filename> IDENTIFIER <id> CATEGORY_NAME <name>
# EXPORT <target> DESCRIPTION <desc>)
#
# Example:
# declare_qt_logging_category(Foo_LIB_SRCS
# _declare_qt_logging_category(Foo_LIB_SRCS
# HEADER debug.h
# IDENTIFIER DOCUMENTATION
# IDENTIFIER FOO
# CATEGORY_NAME "bar.foo"
# DESCRIPTION "The foo of bar"
# EXPORT BarCategories
# )
macro(declare_qt_logging_category _sources)
macro(_declare_qt_logging_category sources)
set(options )
set(oneValueArgs HEADER IDENTIFIER CATEGORY_NAME EXPORT DESCRIPTION)
set(multiValueArgs)
......@@ -79,26 +84,26 @@ macro(declare_qt_logging_category _sources)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT DEFINED ARGS_HEADER)
message(FATAL_ERROR "HEADER needs to be defined when calling declare_qt_logging_category().")
message(FATAL_ERROR "HEADER needs to be defined when calling _declare_qt_logging_category().")
endif()
if(NOT DEFINED ARGS_IDENTIFIER)
message(FATAL_ERROR "IDENTIFIER needs to be defined when calling declare_qt_logging_category().")
message(FATAL_ERROR "IDENTIFIER needs to be defined when calling _declare_qt_logging_category().")
endif()
if(NOT DEFINED ARGS_CATEGORY_NAME)
message(FATAL_ERROR "CATEGORY_NAME needs to be defined when calling declare_qt_logging_category().")
message(FATAL_ERROR "CATEGORY_NAME needs to be defined when calling _declare_qt_logging_category().")
endif()
if(NOT DEFINED ARGS_DESCRIPTION)
message(FATAL_ERROR "DESCRIPTION needs to be defined when calling declare_qt_logging_category().")
message(FATAL_ERROR "DESCRIPTION needs to be defined when calling _declare_qt_logging_category().")
endif()
ecm_qt_declare_logging_category(${_sources}
ecm_qt_declare_logging_category(${sources}
HEADER ${ARGS_HEADER}
IDENTIFIER ${ARGS_IDENTIFIER}
CATEGORY_NAME ${ARGS_CATEGORY_NAME}
)
# Nasty hack: we create a target just to store all the category data in some build-system global object
# which then can be accessed from other places like install_qt_logging_categories().
# which then can be accessed from other places like _install_qt_logging_categories().
# we also create it here on first usage, to spare some additional call.
# Better idea how to solve that welcome
set(_targetname "qt_logging_category_${ARGS_EXPORT}")
......@@ -115,28 +120,112 @@ macro(declare_qt_logging_category _sources)
endmacro()
# install_qt_logging_categories(EXPORT <target> FILE <name>)
set(_platformlib_qt_logging_categories_export_name "KDevPlatformCategories")
set(_app_plugin_qt_logging_categories_export_name "KDevelopCategories")
# declare_qt_logging_category(<sourcevarname>
# TYPE LIBRARY|PLUGIN|APP [IDENTIFIER <id>] [CATEGORY_BASENAME <name>]
# [HEADER <filename>] [DESCRIPTION <desc>])
#
# CATEGORY_BASENAME <name> is unused of TYPE APP.
# IDENTIFIER <id> defaults to upper-case CATEGORY_BASENAME <name>.
# HEADER <filename> defaults to "debug.h"
# DESCRIPTION <desc> defaults to CATEGORY_BASENAME <name>.
#
# Example:
# declare_qt_logging_category(Foo_LIB_SRCS
# TYPE PLUGIN
# HEADER foodebug.h
# IDENTIFIER FOO
# CATEGORY_BASENAME "foo"
# )
macro(declare_qt_logging_category sources)
set(options )
set(oneValueArgs HEADER IDENTIFIER CATEGORY_BASENAME DESCRIPTION TYPE)
set(multiValueArgs)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT DEFINED ARGS_TYPE)
message(FATAL_ERROR "TYPE needs to be defined when calling declare_qt_logging_category().")
endif()
if(NOT DEFINED ARGS_IDENTIFIER)
if(ARGS_TYPE STREQUAL "LIBRARY" OR ARGS_TYPE STREQUAL "PLUGIN")
string(TOUPPER ${ARGS_CATEGORY_BASENAME} ARGS_IDENTIFIER)
else()
message(FATAL_ERROR "IDENTIFIER needs to be defined when calling declare_qt_logging_category().")
endif()
endif()
if(NOT DEFINED ARGS_CATEGORY_BASENAME)
if(ARGS_TYPE STREQUAL "LIBRARY" OR ARGS_TYPE STREQUAL "PLUGIN")
message(FATAL_ERROR "CATEGORY_BASENAME needs to be defined when calling declare_qt_logging_category() with TYPE of LIBRARY or PLUGIN.")
endif()
endif()
if(NOT DEFINED ARGS_HEADER)
set(ARGS_HEADER debug.h)
endif()
if(NOT DEFINED ARGS_DESCRIPTION)
set(ARGS_DESCRIPTION ${ARGS_CATEGORY_BASENAME})
endif()
if(ARGS_TYPE STREQUAL "LIBRARY")
_declare_qt_logging_category(${sources}
HEADER ${ARGS_HEADER}
IDENTIFIER ${ARGS_IDENTIFIER}
CATEGORY_NAME "kdevplatform.${ARGS_CATEGORY_BASENAME}"
DESCRIPTION "KDevPlatform lib: ${ARGS_DESCRIPTION}"
EXPORT ${_platformlib_qt_logging_categories_export_name}
)
elseif(ARGS_TYPE STREQUAL "PLUGIN")
_declare_qt_logging_category(${sources}
HEADER ${ARGS_HEADER}
IDENTIFIER ${ARGS_IDENTIFIER}
CATEGORY_NAME "kdevelop.plugins.${ARGS_CATEGORY_BASENAME}"
DESCRIPTION "KDevelop plugin: ${ARGS_DESCRIPTION}"
EXPORT ${_app_plugin_qt_logging_categories_export_name}
)
elseif(ARGS_TYPE STREQUAL "APP")
_declare_qt_logging_category(${sources}
HEADER ${ARGS_HEADER}
IDENTIFIER ${ARGS_IDENTIFIER}
CATEGORY_NAME "kdevelop.app"
DESCRIPTION "KDevelop app"
EXPORT ${_app_plugin_qt_logging_categories_export_name}
)
else()
message(FATAL_ERROR "Unknown \"${ARGS_TYPE}\" with TYPE when calling declare_qt_logging_category().")
endif()
endmacro()
# helper method
# _install_qt_logging_categories(EXPORT <target> FILE <name> MACRONAME <macro>)
#
# Needs to be called after the last declare_qt_logging_category call which uses the same EXPORT name.
# Needs to be called after the last _declare_qt_logging_category call which uses the same EXPORT name.
#
# Example:
# install_qt_logging_categories(
# _install_qt_logging_categories(
# EXPORT KDevPlatformCategories
# FILE kdevplatform.test.categories
# FILE kdevplatform.categories
# )
function(install_qt_logging_categories)
function(_install_qt_logging_categories)
set(options )
set(oneValueArgs FILE EXPORT)
set(oneValueArgs FILE EXPORT MACRONAME)
set(multiValueArgs)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT DEFINED ARGS_FILE)
message(FATAL_ERROR "FILE needs to be defined when calling install_qt_logging_categories().")
message(FATAL_ERROR "FILE needs to be defined when calling _install_qt_logging_categories().")
endif()
if(NOT DEFINED ARGS_EXPORT)
message(FATAL_ERROR "EXPORT needs to be defined when calling install_qt_logging_categories().")
message(FATAL_ERROR "EXPORT needs to be defined when calling _install_qt_logging_categories().")
endif()
if(NOT DEFINED ARGS_MACRONAME)
message(FATAL_ERROR "MACRONAME needs to be defined when calling _install_qt_logging_categories().")
endif()
set(_targetname "qt_logging_category_${ARGS_EXPORT}")
......@@ -149,7 +238,7 @@ function(install_qt_logging_categories)
set(_content
"# KDebugSettings data file
# This file was generated by install_qt_logging_categories(). DO NOT EDIT!
# This file was generated by ${ARGS_MACRONAME}(). DO NOT EDIT!
")
......@@ -180,3 +269,34 @@ function(install_qt_logging_categories)
DESTINATION ${KDE_INSTALL_CONFDIR}
)
endfunction()
# install_qt_logging_categories(TYPE LIBRARY|APP_PLUGIN)
#
# Needs to be called after the last declare_qt_logging_category call for the same TYPE(s).
function(install_qt_logging_categories)
set(options )
set(oneValueArgs TYPE)
set(multiValueArgs)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT DEFINED ARGS_TYPE)
message(FATAL_ERROR "TYPE needs to be defined when calling install_qt_logging_categories().")
endif()
if(ARGS_TYPE STREQUAL "LIBRARY")
_install_qt_logging_categories(
EXPORT ${_platformlib_qt_logging_categories_export_name}
FILE kdevplatform.categories
MACRONAME install_qt_logging_categories
)
elseif(ARGS_TYPE STREQUAL "APP_PLUGIN")
_install_qt_logging_categories(
EXPORT ${_app_plugin_qt_logging_categories_export_name}
FILE kdevelop.categories
MACRONAME install_qt_logging_categories
)
else()
message(FATAL_ERROR "Unknown \"${ARGS_TYPE}\" with TYPE when calling declare_qt_logging_category().")
endif()
endfunction()
# KDebugSettings data file
# Format:
# logname<space>description
# Plugins
kdevelop.plugins.android KDevelop plugin: android
kdevelop.plugins.appwizard KDevelop plugin: appwizard
kdevelop.plugins.astyle KDevelop plugin: astyle
kdevelop.plugins.clang KDevelop plugin: clang-based language support
kdevelop.plugins.clangtidy KDevelop plugin: clangtidy
kdevelop.plugins.classbrowser KDevelop plugin: classbrowser
kdevelop.plugins.clazy KDevelop plugin: clazy
kdevelop.plugins.cmake KDevelop plugin: cmake
kdevelop.plugins.cmakebuilder KDevelop plugin: cmakebuilder
kdevelop.plugins.codeutils KDevelop plugin: codeutils
kdevelop.plugins.common KDevelop plugin: debuggers common
kdevelop.plugins.contextbrowser KDevelop plugin: contextbrowser
kdevelop.plugins.cppcheck KDevelop plugin: cppcheck
kdevelop.plugins.custombuildsystem KDevelop plugin: custombuildsystem
kdevelop.plugins.custommake KDevelop plugin: custommake
kdevelop.plugins.customscript KDevelop plugin: customscript
kdevelop.plugins.cvs KDevelop plugin: cvs
kdevelop.plugins.definesandincludes KDevelop plugin: definesandincludes
kdevelop.plugins.docker KDevelop plugin: docker
kdevelop.plugins.documentswitcher KDevelop plugin: documentswitcher
kdevelop.plugins.execute KDevelop plugin: execute
kdevelop.plugins.executeplasmoid KDevelop plugin: executeplasmoid
kdevelop.plugins.executescript KDevelop plugin: executescript
kdevelop.plugins.externalscript KDevelop plugin: externalscript
kdevelop.plugins.filemanager KDevelop plugin: filemanager
kdevelop.plugins.filetemplates KDevelop plugin: filetemplates
kdevelop.plugins.flatpak KDevelop plugin: flatpak
kdevelop.plugins.gdb KDevelop plugin: gdb
kdevelop.plugins.ghprovider KDevelop plugin: githubprovider
kdevelop.plugins.git KDevelop plugin: git
kdevelop.plugins.grepview KDevelop plugin: grepview
kdevelop.plugins.heaptrack KDevelop plugin: heaptrack
kdevelop.plugins.konsole KDevelop plugin: konsole
kdevelop.plugins.lldb KDevelop plugin: lldb
kdevelop.plugins.makebuilder KDevelop plugin: makebuilder
kdevelop.plugins.ninjabuilder KDevelop plugin: ninjabuilder
kdevelop.plugins.outline KDevelop plugin: outline
kdevelop.plugins.patchreview KDevelop plugin: patchreview
kdevelop.plugins.perforce KDevelop plugin: perforce
kdevelop.plugins.problemreporter KDevelop plugin: problemreporter
kdevelop.plugins.projectfilter KDevelop plugin: projectfilter
kdevelop.plugins.projectmanagerview KDevelop plugin: projectmanagerview
kdevelop.plugins.qmake KDevelop plugin: qmake
kdevelop.plugins.qmakebuilder KDevelop plugin: qmakebuilder
kdevelop.plugins.qmljs KDevelop plugin: qmljs
kdevelop.plugins.qmljs.duchain KDevelop plugin: qmljs duchain
kdevelop.plugins.qthelp KDevelop plugin: qthelp
kdevelop.plugins.quickopen KDevelop plugin: quickopen
kdevelop.plugins.standardoutputview KDevelop plugin: standardoutputview
kdevelop.plugins.svn KDevelop plugin: svn
kdevelop.plugins.switchtobuddy KDevelop plugin: switchtobuddy
kdevelop.plugins.testview KDevelop plugin: testview
kdevelop.plugins.welcomepage KDevelop plugin: welcomepage
# Programs
kdevelop.app KDevelop app
......@@ -89,7 +89,4 @@ install( EXPORT KDevPlatformTargets
FILE KDevPlatformTargets.cmake )
# kdebugsettings file
install_qt_logging_categories(
EXPORT KDevPlatformCategories
FILE kdevplatform.categories
)
install_qt_logging_categories(TYPE LIBRARY)
......@@ -21,11 +21,8 @@ set(KDevPlatformDebugger_LIB_SRCS
framestack/framestackwidget.cpp
)
declare_qt_logging_category(KDevPlatformDebugger_LIB_SRCS
HEADER debug.h
IDENTIFIER DEBUGGER
CATEGORY_NAME "kdevplatform.debugger"
DESCRIPTION "KDevPlatform lib: debugger"
EXPORT KDevPlatformCategories
TYPE LIBRARY
CATEGORY_BASENAME "debugger"
)
kdevplatform_add_library(KDevPlatformDebugger SOURCES ${KDevPlatformDebugger_LIB_SRCS})
target_link_libraries(KDevPlatformDebugger
......
......@@ -22,11 +22,8 @@ set(KDevPlatformDocumentation_LIB_SRCS
)
declare_qt_logging_category(KDevPlatformDocumentation_LIB_SRCS
HEADER debug.h
IDENTIFIER DOCUMENTATION
CATEGORY_NAME "kdevplatform.documentation"
DESCRIPTION "KDevPlatform lib: documentation"
EXPORT KDevPlatformCategories
TYPE LIBRARY
CATEGORY_BASENAME "documentation"
)
ki18n_wrap_ui(KDevPlatformDocumentation_LIB_SRCS documentationfindwidget.ui)
......
......@@ -171,11 +171,8 @@ set(KDevPlatformLanguage_LIB_SRCS
)
declare_qt_logging_category(KDevPlatformLanguage_LIB_SRCS
HEADER debug.h
IDENTIFIER LANGUAGE
CATEGORY_NAME "kdevplatform.language"
DESCRIPTION "KDevPlatform lib: language"
EXPORT KDevPlatformCategories
TYPE LIBRARY
CATEGORY_BASENAME "language"
)
ki18n_wrap_ui(KDevPlatformLanguage_LIB_SRCS
......
......@@ -13,11 +13,8 @@ set(outputviewinterfaces_LIB_SRCS
outputexecutejob.cpp
)
declare_qt_logging_category(outputviewinterfaces_LIB_SRCS
HEADER debug.h
IDENTIFIER OUTPUTVIEW
CATEGORY_NAME "kdevplatform.outputview"
DESCRIPTION "KDevPlatform lib: outputview"
EXPORT KDevPlatformCategories
TYPE LIBRARY
CATEGORY_BASENAME "outputview"
)
kdevplatform_add_library(KDevPlatformOutputView SOURCES ${outputviewinterfaces_LIB_SRCS})
target_link_libraries(KDevPlatformOutputView
......
......@@ -23,19 +23,15 @@ set(KDevPlatformProject_LIB_SRCS
)
declare_qt_logging_category(KDevPlatformProject_LIB_SRCS
TYPE LIBRARY
HEADER debug_project.h
IDENTIFIER PROJECT
CATEGORY_NAME "kdevplatform.project"
DESCRIPTION "KDevPlatform lib: project"
EXPORT KDevPlatformCategories
CATEGORY_BASENAME "project"
)
declare_qt_logging_category(KDevPlatformProject_LIB_SRCS
TYPE LIBRARY
HEADER debug_filemanager.h
IDENTIFIER FILEMANAGER
CATEGORY_NAME "kdevplatform.filemanager"
DESCRIPTION "KDevPlatform lib: filemanager"
EXPORT KDevPlatformCategories
CATEGORY_BASENAME "filemanager"
)
ki18n_wrap_ui( KDevPlatformProject_LIB_SRCS widgets/dependencieswidget.ui)
......
......@@ -8,11 +8,8 @@ set(KDevPlatformSerialization_LIB_SRCS
)
declare_qt_logging_category(KDevPlatformSerialization_LIB_SRCS
HEADER debug.h
IDENTIFIER SERIALIZATION
CATEGORY_NAME "kdevplatform.serialization"
DESCRIPTION "KDevPlatform lib: serialization"
EXPORT KDevPlatformCategories
TYPE LIBRARY
CATEGORY_BASENAME "serialization"
)
kdevplatform_add_library(KDevPlatformSerialization SOURCES ${KDevPlatformSerialization_LIB_SRCS})
......
......@@ -97,11 +97,8 @@ if(APPLE)
endif()
declare_qt_logging_category(KDevPlatformShell_LIB_SRCS
HEADER debug.h
IDENTIFIER SHELL
CATEGORY_NAME "kdevplatform.shell"
DESCRIPTION "KDevPlatform lib: shell"
EXPORT KDevPlatformCategories
TYPE LIBRARY
CATEGORY_BASENAME "shell"
)
kconfig_add_kcfg_files(KDevPlatformShell_LIB_SRCS
......
......@@ -29,11 +29,8 @@ set(sublime_LIB_SRCS
idealbuttonbarwidget.cpp
)
declare_qt_logging_category(sublime_LIB_SRCS
HEADER debug.h
IDENTIFIER SUBLIME
CATEGORY_NAME "kdevplatform.sublime"
DESCRIPTION "KDevPlatform lib: sublime"
EXPORT KDevPlatformCategories
TYPE LIBRARY
CATEGORY_BASENAME "sublime"
)
kdevplatform_add_library(KDevPlatformSublime SOURCES ${sublime_LIB_SRCS})
target_link_libraries(KDevPlatformSublime
......
......@@ -46,11 +46,8 @@ if(BUILD_TESTING)
endif()
declare_qt_logging_category(KDevPlatformUtil_LIB_SRCS
HEADER debug.h
IDENTIFIER UTIL
CATEGORY_NAME "kdevplatform.util"
DESCRIPTION "KDevPlatform lib: util"
EXPORT KDevPlatformCategories
TYPE LIBRARY
CATEGORY_BASENAME "util"
)
ki18n_wrap_ui(KDevPlatformUtil_LIB_SRCS ${KDevPlatformUtil_LIB_US})
......
......@@ -47,11 +47,8 @@ set(KDevPlatformVcs_LIB_SRCS
)
declare_qt_logging_category(KDevPlatformVcs_LIB_SRCS
HEADER debug.h
IDENTIFIER VCS
CATEGORY_NAME "kdevplatform.vcs"
DESCRIPTION "KDevPlatform lib: vcs"
EXPORT KDevPlatformCategories
TYPE LIBRARY
CATEGORY_BASENAME "vcs"
)
ki18n_wrap_ui(KDevPlatformVcs_LIB_SRCS ${KDevPlatformVcs_UIS})
......
add_definitions(-DTRANSLATION_DOMAIN=\"kdevandroid\")
ecm_qt_declare_logging_category(androidplugin_SRCS
declare_qt_logging_category(androidplugin_SRCS
TYPE PLUGIN
HEADER debug_android.h
IDENTIFIER ANDROID
CATEGORY_NAME "kdevelop.plugins.android"
CATEGORY_BASENAME "android"
)
qt5_add_resources(androidplugin_SRCS kdevandroidplugin.qrc)
ki18n_wrap_ui(androidplugin_SRCS androidpreferences.ui)
......
......@@ -16,10 +16,10 @@ set(kdevappwizard_PART_UI
projectvcspage.ui
)
ecm_qt_declare_logging_category(kdevappwizard_PART_SRCS
HEADER debug.h
declare_qt_logging_category(kdevappwizard_PART_SRCS
TYPE PLUGIN
IDENTIFIER PLUGIN_APPWIZARD
CATEGORY_NAME "kdevelop.plugins.appwizard"
CATEGORY_BASENAME "appwizard"
)
ki18n_wrap_ui(kdevappwizard_PART_SRCS ${kdevappwizard_PART_UI})
......
add_definitions(-DTRANSLATION_DOMAIN=\"kdevastyle\")
ecm_qt_declare_logging_category(kdevastyle_LOG_SRCS
HEADER debug.h
declare_qt_logging_category(kdevastyle_LOG_SRCS
TYPE PLUGIN
IDENTIFIER KDEV_ASTYLE
CATEGORY_NAME "kdevelop.plugins.astyle"
CATEGORY_BASENAME "astyle"
)
set(kdevastyle_PART_SRCS
......
......@@ -77,6 +77,18 @@ set(kdevclangprivate_SRCS
util/clangtypes.cpp
util/clangutils.cpp
)
# dummy call to add the data to KDevelopCategories
# util/clangdebug.* cannot easily be generated with ecm_qt_declare_logging_category
# as the current code does not use Q_DECLARE_LOGGING_CATEGORY but instead
# has explicit code to tag KDEV_CLANG() as KDEVCLANGPRIVATE_EXPORT
# Keep in sync with util/clangdebug.*
declare_qt_logging_category(dummy_kdevclangprivate_SRCS
TYPE PLUGIN
HEADER dummy_debug.h
IDENTIFIER KDEV_CLANG
CATEGORY_BASENAME "clang"
DESCRIPTION "clang-based language support"
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
......
......@@ -27,6 +27,7 @@
#include <language/editor/documentcursor.h>
#include <language/editor/documentrange.h>
// Keep in sync with declare_qt_logging_category call
const QtMsgType defaultMsgType = QtInfoMsg;
Q_LOGGING_CATEGORY(KDEV_CLANG, "kdevelop.plugins.clang", defaultMsgType)
......
......@@ -11,10 +11,10 @@ include_directories(
${Boost_INCLUDE_DIRS}
)
ecm_qt_declare_logging_category(kdevclangtidy_LOG_SRCS
HEADER debug.h
declare_qt_logging_category(kdevclangtidy_LOG_SRCS
TYPE PLUGIN
IDENTIFIER KDEV_CLANGTIDY
CATEGORY_NAME "kdevelop.plugins.clangtidy"
CATEGORY_BASENAME "clangtidy"
)
set(kdevclangtidy_PART_SRCS
......
......@@ -14,10 +14,10 @@ set(kdevclassbrowser_PART_SRCS
classwidget.cpp
classtree.cpp
)
ecm_qt_declare_logging_category(kdevclassbrowser_PART_SRCS
HEADER debug.h
declare_qt_logging_category(kdevclassbrowser_PART_SRCS
TYPE PLUGIN
IDENTIFIER PLUGIN_CLASSBROWSER
CATEGORY_NAME "kdevelop.plugins.classbrowser"
CATEGORY_BASENAME "classbrowser"
)
qt5_add_resources(kdevclassbrowser_PART_SRCS kdevclassbrowser.qrc)
kdevplatform_add_plugin(kdevclassbrowser JSON kdevclassbrowser.json SOURCES ${kdevclassbrowser_PART_SRCS})
......
......@@ -14,10 +14,10 @@ set(kdevclazy_core_SRCS
jobparameters.cpp
utils.cpp
)
ecm_qt_declare_logging_category(kdevclazy_core_SRCS
HEADER debug.h
declare_qt_logging_category(kdevclazy_core_SRCS
TYPE PLUGIN
IDENTIFIER KDEV_CLAZY
CATEGORY_NAME "kdevelop.plugins.clazy"
CATEGORY_BASENAME "clazy"
)
kconfig_add_kcfg_files(kdevclazy_core_SRCS GENERATE_MOC
config/globalsettings.kcfgc
......
......@@ -10,10 +10,10 @@ add_subdirectory(icons)
# the debug visitor prints out the Ast for the CMakeLists.txt file.
#add_definitions( -DCMAKEDEBUGVISITOR )
ecm_qt_declare_logging_category(cmake_LOG_SRCS
HEADER debug.h
declare_qt_logging_category(cmake_LOG_SRCS
TYPE PLUGIN
IDENTIFIER CMAKE
CATEGORY_NAME "kdevelop.plugins.cmake"
CATEGORY_BASENAME "cmake"
)
set( cmakecommon_SRCS
......
......@@ -9,10 +9,10 @@ set(cmakebuilder_SRCS
cmakebuilderpreferences.cpp
)
ecm_qt_declare_logging_category(cmakebuilder_SRCS
HEADER debug.h
declare_qt_logging_category(cmakebuilder_SRCS
TYPE PLUGIN
IDENTIFIER KDEV_CMAKEBUILDER
CATEGORY_NAME "kdevelop.plugins.cmakebuilder"
CATEGORY_BASENAME "cmakebuilder"
)
ki18n_wrap_ui(cmakebuilder_SRCS cmakebuilderpreferences.ui)
kdevplatform_add_plugin(kdevcmakebuilder JSON kdevcmakebuilder.json SOURCES ${cmakebuilder_SRCS})
......
......@@ -6,10 +6,10 @@ set(kdevcodeutils_PART_SRCS
codeutilsplugin.cpp
)
ecm_qt_declare_logging_category(kdevcodeutils_PART_SRCS
HEADER debug.h
declare_qt_logging_category(kdevcodeutils_PART_SRCS
TYPE PLUGIN
IDENTIFIER PLUGIN_CODEUTILS
CATEGORY_NAME "kdevelop.plugins.codeutils"
CATEGORY_BASENAME "codeutils"
)
qt5_add_resources(kdevcodeutils_PART_SRCS kdevcodeutils.qrc)
kdevplatform_add_plugin(kdevcodeutils JSON kdevcodeutils.json SOURCES ${kdevcodeutils_PART_SRCS})
......
......@@ -8,10 +8,10 @@ set(kdevcontextbrowser_PART_SRCS
browsemanager.cpp
)
ecm_qt_declare_logging_category(kdevcontextbrowser_PART_SRCS
HEADER debug.h
declare_qt_logging_category(kdevcontextbrowser_PART_SRCS
TYPE PLUGIN
IDENTIFIER PLUGIN_CONTEXTBROWSER
CATEGORY_NAME "kdevelop.plugins.contextbrowser"
CATEGORY_BASENAME "contextbrowser"
)
qt5_add_resources(kdevcontextbrowser_PART_SRCS kdevcontextbrowser.qrc)
kdevplatform_add_plugin(kdevcontextbrowser JSON kdevcontextbrowser.json SOURCES ${kdevcontextbrowser_PART_SRCS})
......
......@@ -14,10 +14,10 @@ set(kdevcppcheck_core_SRCS
parameters.cpp
utils.cpp
)
ecm_qt_declare_logging_category(kdevcppcheck_core_SRCS
HEADER debug.h
declare_qt_logging_category(kdevcppcheck_core_SRCS
TYPE PLUGIN
IDENTIFIER KDEV_CPPCHECK
CATEGORY_NAME "kdevelop.plugins.cppcheck"
CATEGORY_BASENAME "cppcheck"
)
kconfig_add_kcfg_files(kdevcppcheck_core_SRCS
config/globalsettings.kcfgc
......
add_definitions(-DTRANSLATION_DOMAIN=\"kdevcustombuildsystem\")
ecm_qt_declare_logging_category(custom_LOG_SRCS
HEADER debug.h
declare_qt_logging_category(custom_LOG_SRCS
TYPE PLUGIN
IDENTIFIER CUSTOMBUILDSYSTEM
CATEGORY_NAME "kdevelop.plugins.custombuildsystem"
CATEGORY_BASENAME "custombuildsystem"
)
## KDevelop Plugin
set(custom_SRCS
......
add_definitions(-DTRANSLATION_DOMAIN=\"kdevcustomdefinesandincludes\")
ecm_qt_declare_logging_category(kdevdefinesandincludesmanager_LOG_SRCS
HEADER debug.h
declare_qt_logging_category(kdevdefinesandincludesmanager_LOG_SRCS
TYPE PLUGIN
IDENTIFIER DEFINESANDINCLUDES
CATEGORY_NAME "kdevelop.plugins.definesandincludes"
CATEGORY_BASENAME "definesandincludes"
)
if(BUILD_TESTING)
......
......@@ -5,10 +5,10 @@ set(kdevcustommakemanager_PART_SRCS
custommakemodelitems.cpp
)
ecm_qt_declare_logging_category(kdevcustommakemanager_PART_SRCS
HEADER debug.h
declare_qt_logging_category(kdevcustommakemanager_PART_SRCS
TYPE PLUGIN
IDENTIFIER CUSTOMMAKE
CATEGORY_NAME "kdevelop.plugins.custommake"
CATEGORY_BASENAME "custommake"
)
qt5_add_resources(kdevcustommakemanager_PART_SRCS kdevcustommakemanager.qrc)
kdevplatform_add_plugin(kdevcustommakemanager JSON kdevcustommakemanager.json SOURCES ${kdevcustommakemanager_PART_SRCS})
......
......@@ -3,10 +3,10 @@ set(kdevcustomscript_PART_SRCS
customscript_plugin.cpp