Warning, /frameworks/extra-cmake-modules/tests/ECMQtDeclareLoggingCategoryTest/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.5)
0002 project(ECMQtDeclareLoggingCategoryTest)
0003 set(ECM_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../modules")
0004 
0005 set(CMAKE_MODULE_PATH ${ECM_MODULE_DIR})
0006 
0007 include(QtVersionOption)
0008 include(ECMQtDeclareLoggingCategory)
0009 include(CMakeParseArguments)
0010 
0011 ecm_qt_declare_logging_category(
0012     sources
0013     HEADER "log1.h"
0014     IDENTIFIER "log1"
0015     CATEGORY_NAME "log.one"
0016     OLD_CATEGORY_NAMES "log1old"
0017     DESCRIPTION "log 1"
0018     EXPORT LOG
0019 )
0020 
0021 ecm_qt_declare_logging_category(
0022     sources
0023     HEADER "log2.h"
0024     IDENTIFIER "foo::bar::log2"
0025     CATEGORY_NAME "log.two"
0026     DEFAULT_SEVERITY Info
0027     DESCRIPTION "log 2"
0028     EXPORT LOG
0029 )
0030 
0031 ecm_qt_declare_logging_category(
0032     sources
0033     HEADER "${CMAKE_CURRENT_BINARY_DIR}/log3.h"
0034     IDENTIFIER "log3"
0035     CATEGORY_NAME "three"
0036     DEFAULT_SEVERITY Critical
0037 )
0038 
0039 ecm_qt_export_logging_category(
0040     IDENTIFIER "log4"
0041     CATEGORY_NAME "log.four"
0042     OLD_CATEGORY_NAMES "logfouroldest" "log4old"
0043     DEFAULT_SEVERITY Warning
0044     EXPORT LOG
0045     DESCRIPTION "log 4"
0046 )
0047 
0048 find_package(Qt${QT_MAJOR_VERSION}Core REQUIRED)
0049 
0050 add_executable(testmain testmain.cpp ${sources})
0051 target_include_directories(testmain
0052     PRIVATE
0053         "${CMAKE_CURRENT_BINARY_DIR}"
0054 )
0055 target_link_libraries(testmain
0056     PRIVATE
0057         Qt${QT_MAJOR_VERSION}::Core
0058 )
0059 
0060 ecm_qt_install_logging_categories(
0061     EXPORT LOG
0062     FILE log.categories
0063     DESTINATION "${CMAKE_INSTALL_PREFIX}/share/qlogging-categories5"
0064 )
0065 
0066 # this will be run by CTest
0067 configure_file(check.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check.cmake" @ONLY)