Pass a target instead of a CMake variable as the first argument to ecm_qt_declare_logging_category()
From https://api.kde.org/ecm/module/ECMQtDeclareLoggingCategory.html:
The generated source file will be added to the variable with the name
<sources_var_name>
. If the given argument is a target though, instead both the generated header file and the generated source file will be added to the target as private sources (since 5.80). The target must not be an alias.
KDevelop already requires KF5 version >= 5.91.0. If we pass a target instead of a CMake variable as the first argument to ecm_qt_declare_logging_category()
, debug.h files will appear in the Quick Open list.
However, sometimes we add the LOG_SRCS
CMake variable to several targets, e.g. ${cmake_LOG_SRCS}
in plugins/cmake/CMakeLists.txt. @kossebau, I see that you have implemented the ECM feature in frameworks/extra-cmake-modules!85 (merged). Is there a way to add both the generated header file and the generated source file to multiple targets?