Commit ccfaf1a1 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

cmake: Rework how tabbox is conditionally compiled into libkwin

In modern CMake code, it is highly advised to avoid using variables. One
should instead try to use targets and properties more extensively.
parent 9af78c0e
...@@ -560,21 +560,6 @@ set(kwin_SRCS ...@@ -560,21 +560,6 @@ set(kwin_SRCS
xwl/xwayland_interface.cpp xwl/xwayland_interface.cpp
) )
if (KWIN_BUILD_TABBOX)
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
set(kwin_SRCS ${kwin_SRCS}
tabbox/clientmodel.cpp
tabbox/desktopchain.cpp
tabbox/desktopmodel.cpp
tabbox/switcheritem.cpp
tabbox/tabbox.cpp
tabbox/tabbox_logging.cpp
tabbox/tabboxconfig.cpp
tabbox/tabboxhandler.cpp
tabbox/x11_filter.cpp
)
endif()
if (HAVE_LINUX_VT_H) if (HAVE_LINUX_VT_H)
set(kwin_SRCS ${kwin_SRCS} set(kwin_SRCS ${kwin_SRCS}
virtual_terminal.cpp virtual_terminal.cpp
...@@ -711,6 +696,21 @@ if (KWIN_BUILD_ACTIVITIES) ...@@ -711,6 +696,21 @@ if (KWIN_BUILD_ACTIVITIES)
target_link_libraries(kwin KF5::Activities) target_link_libraries(kwin KF5::Activities)
endif() endif()
if (KWIN_BUILD_TABBOX)
target_sources(kwin PRIVATE
tabbox/clientmodel.cpp
tabbox/desktopchain.cpp
tabbox/desktopmodel.cpp
tabbox/switcheritem.cpp
tabbox/tabbox.cpp
tabbox/tabbox_logging.cpp
tabbox/tabboxconfig.cpp
tabbox/tabboxhandler.cpp
tabbox/x11_filter.cpp
)
target_include_directories(kwin PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
endif()
generate_export_header(kwin EXPORT_FILE_NAME kwin_export.h) generate_export_header(kwin EXPORT_FILE_NAME kwin_export.h)
if(CMAKE_SYSTEM MATCHES "FreeBSD") if(CMAKE_SYSTEM MATCHES "FreeBSD")
......
...@@ -32,6 +32,7 @@ target_link_libraries(testTabBoxClientModel ...@@ -32,6 +32,7 @@ target_link_libraries(testTabBoxClientModel
XCB::XCB XCB::XCB
) )
target_include_directories(testTabBoxClientModel PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
add_test(NAME kwin-testTabBoxClientModel COMMAND testTabBoxClientModel) add_test(NAME kwin-testTabBoxClientModel COMMAND testTabBoxClientModel)
ecm_mark_as_test(testTabBoxClientModel) ecm_mark_as_test(testTabBoxClientModel)
...@@ -67,6 +68,7 @@ target_link_libraries(testTabBoxHandler ...@@ -67,6 +68,7 @@ target_link_libraries(testTabBoxHandler
XCB::XCB XCB::XCB
) )
target_include_directories(testTabBoxHandler PRIVATE ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
add_test(NAME kwin-testTabBoxHandler COMMAND testTabBoxHandler) add_test(NAME kwin-testTabBoxHandler COMMAND testTabBoxHandler)
ecm_mark_as_test(testTabBoxHandler) ecm_mark_as_test(testTabBoxHandler)
......
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