Commit 2a96a398 authored by Stefan Brüns's avatar Stefan Brüns
Browse files

[kio/man] Use ecm_qt_declare_logging_category

Use an intermediate OBJECT library target for the
debug sources, to link it from kio_man proper, and
also from the tests.
parent a74992db
......@@ -16,9 +16,20 @@ if(BUILD_TESTING)
add_subdirectory( tests )
endif()
# intermediate target/library, also used by the tests
add_library(kio_man_debug OBJECT)
target_link_libraries(kio_man_debug
PRIVATE Qt5::Core
)
ecm_qt_declare_logging_category(kio_man_debug
HEADER kio_man_debug.h
IDENTIFIER KIO_MAN_LOG
CATEGORY_NAME log_kio_man
)
########### next target ###############
set(kio_man_PART_SRCS man2html.cpp kio_man.cpp request_hash.cpp kio_man_debug.cpp)
set(kio_man_PART_SRCS man2html.cpp kio_man.cpp request_hash.cpp)
ecm_gperf_generate(requests.gperf ${CMAKE_CURRENT_BINARY_DIR}/request_gperf.h kio_man_PART_SRCS)
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/request_gperf.h PROPERTY SKIP_AUTOMOC ON)
add_library(kio_man MODULE ${kio_man_PART_SRCS})
......@@ -27,7 +38,10 @@ if (AVOID_NULLPTR_WARNING_FLAG)
target_compile_options(kio_man PRIVATE ${AVOID_NULLPTR_WARNING_FLAG})
endif()
target_link_libraries(kio_man KF5::KIOCore Qt5::Widgets KF5::Archive KF5::I18n KF5::Codecs Qt5::Network)
target_link_libraries(kio_man
PRIVATE KF5::KIOCore Qt5::Widgets KF5::Archive KF5::I18n KF5::Codecs Qt5::Network kio_man_debug
)
set_target_properties(kio_man PROPERTIES OUTPUT_NAME "man")
install(TARGETS kio_man DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio)
install(FILES man.protocol DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
/* This file is part of the KDE project
SPDX-FileCopyrightText: 2014 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "kio_man_debug.h"
Q_LOGGING_CATEGORY(KIO_MAN_LOG, "log_kio_man")
/* This file is part of the KDE project
SPDX-FileCopyrightText: 2014 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef KIO_MAN_DEBUG_H
#define KIO_MAN_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(KIO_MAN_LOG)
#endif
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. )
########### next target ###############
......@@ -7,7 +8,7 @@ set(kio_man_test_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/../man2html.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../request_hash.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../kio_man.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../kio_man_debug.cpp)
)
ecm_gperf_generate(../requests.gperf ${CMAKE_CURRENT_BINARY_DIR}/request_gperf.h kio_man_test_SRCS)
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/request_gperf.h PROPERTY SKIP_AUTOMOC ON)
......@@ -16,7 +17,7 @@ set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/request_gperf.h PROPERTY SKIP_AU
add_executable(kio_man_test ${kio_man_test_SRCS})
ecm_mark_as_test(kio_man_test)
set_target_properties(kio_man_test PROPERTIES COMPILE_FLAGS "-DSIMPLE_MAN2HTML -DKIO_MAN_TEST")
target_link_libraries(kio_man_test Qt5::Widgets KF5::I18n KF5::KIOCore KF5::Archive KF5::Codecs Qt5::Network)
target_link_libraries(kio_man_test Qt5::Widgets KF5::I18n KF5::KIOCore KF5::Archive KF5::Codecs Qt5::Network kio_man_debug)
if (AVOID_NULLPTR_WARNING_FLAG)
target_compile_options(kio_man_test PRIVATE ${AVOID_NULLPTR_WARNING_FLAG})
endif()
......@@ -28,7 +29,7 @@ endif()
set(man2html_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/../request_hash.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../man2html.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../kio_man_debug.cpp)
)
ecm_gperf_generate(../requests.gperf ${CMAKE_CURRENT_BINARY_DIR}/request_gperf.h man2html_SRCS)
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/request_gperf.h PROPERTY SKIP_AUTOMOC ON)
......@@ -36,7 +37,7 @@ set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/request_gperf.h PROPERTY SKIP_AU
add_executable(man2html ${man2html_SRCS})
ecm_mark_as_test(man2html)
set_target_properties(man2html PROPERTIES COMPILE_FLAGS -DSIMPLE_MAN2HTML)
target_link_libraries(man2html Qt5::Core KF5::Codecs KF5::Archive)
target_link_libraries(man2html Qt5::Core KF5::Codecs KF5::Archive kio_man_debug)
if (AVOID_NULLPTR_WARNING_FLAG)
target_compile_options(man2html PRIVATE ${AVOID_NULLPTR_WARNING_FLAG})
endif()
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