D9446: WIP: Allow to autogenerate and install categories file

Ralf Habacker noreply at phabricator.kde.org
Wed Jun 27 22:12:05 UTC 2018


habacker added a comment.
Restricted Application edited subscribers, added: kde-buildsystem, kde-frameworks-devel; removed: Frameworks, Build System.


  Having support for defining multiple debug categories has an additional  issue as shown with the following example. As far as I can see there should be only one header file for all categories in a repo eg. kcoreaddons_debug.h. To define all available debug categories for kcoreaddons the following cmake code is required.
  
    ecm_qt_declare_logging_category(libkcoreaddons_SRCS
                                    HEADER kcoreaddons_debug.h
                                    IDENTIFIER KCOREADDONS_DEBUG
                                    CATEGORY_NAME org.kde.kcoreaddons
                                    CATEGORY_INSTALL_FILENAME kcoreaddons
                                    CATEGORY_DESCRIPTION kcoreaddons)
    
    ecm_qt_declare_logging_category(libkcoreaddons_SRCS
                                    HEADER kcoreaddons_debug.h
                                    IDENTIFIER MIGRATOR
                                    CATEGORY_NAME kf5.kcoreaddons.kdelibs4configmigrator
                                    DEFAULT_SEVERITY Warning
                                    CATEGORY_INSTALL_FILENAME kcoreaddons
                                    CATEGORY_DESCRIPTION Kdelibs4ConfigMigrator)
    
    ecm_qt_declare_logging_category(libkcoreaddons_SRCS
                                    HEADER kcoreaddons_debug.h
                                    IDENTIFIER KDIRWATCH
                                    CATEGORY_NAME kf5.kcoreaddons.kdirwatch
                                    DEFAULT_SEVERITY Warning
                                    CATEGORY_INSTALL_FILENAME kcoreaddons
                                    CATEGORY_DESCRIPTION KDirWatch)
    
    if(BUILDING_DESKTOPTOJSON_TOOL)
        set(Level Debug)
    else()
        set(Level Warning)
    endif()
    
    ecm_qt_declare_logging_category(libkcoreaddons_SRCS
                                    HEADER kcoreaddons_debug.h
                                    IDENTIFIER DESKTOPPARSER
                                    CATEGORY_NAME kf5.kcoreaddons.desktopparser
                                    DEFAULT_SEVERITY ${LEVEL}
                                    CATEGORY_INSTALL_FILENAME kcoreaddons
                                    CATEGORY_DESCRIPTION KDesktopParser)
    
    ecm_qt_declare_logging_category(libkcoreaddons_SRCS
                                    HEADER kcoreaddons_debug.h
                                    IDENTIFIER KABOUTDATA
                                    CATEGORY_NAME kf5.kcoreaddons.kaboutdata
                                    DEFAULT_SEVERITY Warning
                                    CATEGORY_INSTALL_FILENAME kcoreaddons
                                    CATEGORY_DESCRIPTION KAboutData)
  
  Unfortunally this creates kcoreaddons_debug.h only containing the definition for KABOUTDATA. The alternative to specify different files forces developers to know exactly which file to include for specifing a dedicated debug category.

REPOSITORY
  R240 Extra CMake Modules

REVISION DETAIL
  https://phabricator.kde.org/D9446

To: mlaurent, kfunk, lbeltrame, cgiboudeaux, dfaure, fvogt
Cc: kde-frameworks-devel, kde-buildsystem, habacker, michaelh, ngraham, bruns, #frameworks, #build_system
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20180627/71b4d6bf/attachment-0001.html>


More information about the Kde-buildsystem mailing list