Warning, /frameworks/kdesignerplugin/autotests/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 remove_definitions(-DQT_NO_CAST_FROM_ASCII)
0002 
0003 include(ECMAddTests)
0004 
0005 find_package(Qt${QT_MAJOR_VERSION}Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
0006 find_package(Qt${QT_MAJOR_VERSION}Widgets ${REQUIRED_QT_VERSION} CONFIG QUIET)
0007 if(NOT Qt5Designer_FOUND OR NOT Qt5Test_FOUND OR NOT Qt5Widgets_FOUND)
0008     message(STATUS "Autotests will not be built, as Qt5Designer, Qt5Widgets or Qt5Test was not found.")
0009     return()
0010 endif()
0011 
0012 include(${KDesignerPlugin_SOURCE_DIR}/KF5DesignerPluginMacros.cmake)
0013 
0014 kf5designerplugin_add_plugin(testplugin testplugin.widgets testplugin.qrc)
0015 target_link_libraries(testplugin PRIVATE Qt${QT_MAJOR_VERSION}::Widgets)
0016 kf5designerplugin_add_plugin(minimalplugin minimal.widgets)
0017 target_link_libraries(minimalplugin PRIVATE Qt${QT_MAJOR_VERSION}::Widgets)
0018 
0019 macro(kdp_add_tests)
0020     foreach(f ${ARGN})
0021         get_filename_component(_testname "${f}" NAME_WE)
0022         ecm_add_test(${f}
0023             TEST_NAME ${_testname}
0024             LINK_LIBRARIES
0025                 Qt${QT_MAJOR_VERSION}::Test
0026                 Qt${QT_MAJOR_VERSION}::Widgets
0027         )
0028         target_include_directories(${_testname}
0029             PRIVATE
0030                 ${Qt5Designer_INCLUDE_DIRS}
0031         )
0032         target_compile_definitions(${_testname} PRIVATE
0033             TEST_PLUGIN="$<TARGET_FILE:testplugin>"
0034             MINIMAL_PLUGIN="$<TARGET_FILE:minimalplugin>"
0035         )
0036     endforeach()
0037 endmacro()
0038 
0039 kdp_add_tests(
0040     plugintest.cpp
0041     minimaltest.cpp
0042 )