2017-11-12 20:00:02 +00:00
|
|
|
include_directories(${Libdrm_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
set(mockDRM_SRCS
|
|
|
|
mock_drm.cpp
|
2021-02-09 19:31:40 +00:00
|
|
|
../../src/plugins/platforms/drm/drm_buffer.cpp
|
|
|
|
../../src/plugins/platforms/drm/drm_object.cpp
|
|
|
|
../../src/plugins/platforms/drm/drm_object_connector.cpp
|
|
|
|
../../src/plugins/platforms/drm/drm_object_plane.cpp
|
|
|
|
../../src/plugins/platforms/drm/logging.cpp
|
2017-11-12 20:00:02 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(mockDrm STATIC ${mockDRM_SRCS})
|
2021-01-30 16:18:21 +00:00
|
|
|
target_link_libraries(mockDrm Qt::Gui)
|
2017-11-12 20:00:02 +00:00
|
|
|
ecm_mark_as_test(mockDrm)
|
|
|
|
|
|
|
|
function(drmTest)
|
|
|
|
set(oneValueArgs NAME)
|
|
|
|
set(multiValueArgs SRCS )
|
|
|
|
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
add_executable(${ARGS_NAME} ${ARGS_SRCS})
|
2021-01-30 16:18:21 +00:00
|
|
|
target_link_libraries(${ARGS_NAME} mockDrm Qt::Test)
|
2017-08-25 16:18:20 +00:00
|
|
|
add_test(NAME kwin-drm-${ARGS_NAME} COMMAND ${ARGS_NAME})
|
2017-11-12 20:00:02 +00:00
|
|
|
ecm_mark_as_test(${ARGS_NAME})
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
drmTest(NAME objecttest SRCS objecttest.cpp)
|