Skip to content

Commit

Permalink
build: export file sets
Browse files Browse the repository at this point in the history
Add file sets via FILE_SET keyword and export targets of our libraries.
  • Loading branch information
romangg committed May 27, 2023
1 parent 78ade75 commit 5cb9c3c
Show file tree
Hide file tree
Showing 10 changed files with 803 additions and 50 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later

cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
cmake_minimum_required(VERSION 3.23 FATAL_ERROR)

project(KWinFT VERSION 5.27.80)

Expand Down
100 changes: 90 additions & 10 deletions lib/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,25 @@ target_link_libraries(base
)

target_sources(base
PUBLIC
FILE_SET HEADERS
FILES
os/clock/linux_skew_notifier_engine.h
os/clock/skew_notifier.h
seat/backend/logind/session.h
seat/session.h
app_singleton.h
config.h
logging.h
options.h
output.h
output_helpers.h
output_topology.h
singleton_interface.h
types.h
utils.h
PRIVATE
app_singleton.cpp
os/clock/skew_notifier.cpp
os/clock/skew_notifier_engine.cpp
seat/session.cpp
Expand All @@ -24,13 +42,14 @@ target_sources(base
logging.cpp
options.cpp
platform.cpp

# These headers need to be compiled for the helper QObjects they contain.
output.h
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_sources(base
PUBLIC
FILE_SET HEADERS
FILES
os/clock/skew_notifier_engine.h
PRIVATE
os/clock/linux_skew_notifier_engine.cpp
)
Expand Down Expand Up @@ -59,6 +78,30 @@ target_link_libraries(base-x11
)

target_sources(base-x11
PUBLIC
FILE_SET HEADERS
# TODO(romangg): Should add BASE_DIRS but conflicts with xcb files shadowing system includes.
FILES
x11/atoms.h
x11/data.h
x11/event_filter.h
x11/event_filter_container.h
x11/event_filter_manager.h
x11/fixx11h.h
x11/grabs.h
x11/selection_owner.h
x11/user_interaction_filter.h
x11/xcb/atom.h
x11/xcb/extensions.h
x11/xcb/geometry_hints.h
x11/xcb/helpers.h
x11/xcb/motif_hints.h
x11/xcb/property.h
x11/xcb/proto.h
x11/xcb/qt_types.h
x11/xcb/randr.h
x11/xcb/window.h
x11/xcb/wrapper.h
PRIVATE
x11/event_filter.cpp
x11/event_filter_container.cpp
Expand All @@ -85,12 +128,19 @@ target_link_libraries(base-wl
)

target_sources(base-wl
PUBLIC
FILE_SET HEADERS
BASE_DIRS wayland
FILES
wayland/filtered_display.h
wayland/output.h
wayland/output_helpers.h
wayland/output_transform.h
wayland/platform.h
wayland/screen_lock.h
wayland/server.h
PRIVATE
app_singleton.cpp
wayland/filtered_display.cpp

# These headers need to be compiled for the helper QObjects they contain.
wayland/server.h
)

set_target_properties(base-wl PROPERTIES
Expand All @@ -99,6 +149,36 @@ set_target_properties(base-wl PROPERTIES
OUTPUT_NAME "kwin-base-wl"
)

install(TARGETS base ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS base-x11 ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS base-wl ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS base
EXPORT base-export
${INSTALL_TARGETS_DEFAULT_ARGS}
LIBRARY NAMELINK_SKIP
FILE_SET HEADERS DESTINATION ${KDE_INSTALL_INCLUDEDIR}/kwinft/base
)
install(TARGETS base-x11
EXPORT base-x11-export
${INSTALL_TARGETS_DEFAULT_ARGS}
LIBRARY NAMELINK_SKIP
FILE_SET HEADERS DESTINATION ${KDE_INSTALL_INCLUDEDIR}/kwinft/base
)
install(TARGETS base-wl
EXPORT base-wl-export
${INSTALL_TARGETS_DEFAULT_ARGS}
LIBRARY NAMELINK_SKIP
FILE_SET HEADERS DESTINATION ${KDE_INSTALL_INCLUDEDIR}/kwinft/base/wl
)
install(EXPORT base-export
NAMESPACE kwinft::
${INSTALL_TARGETS_DEFAULT_ARGS}
DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/kwinft
)
install(EXPORT base-x11-export
NAMESPACE kwinft::
${INSTALL_TARGETS_DEFAULT_ARGS}
DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/kwinft
)
install(EXPORT base-wl-export
NAMESPACE kwinft::
${INSTALL_TARGETS_DEFAULT_ARGS}
DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/kwinft
)
50 changes: 47 additions & 3 deletions lib/debug/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,28 @@ target_link_libraries(debug-common
)

target_sources(debug-common
PUBLIC
FILE_SET HEADERS
FILES
console/console.h
console/model_helpers.h
console/window.h
perf/ftrace.h
support_info.h
PRIVATE
console/console.cpp
perf/ftrace.cpp
)

if(HAVE_PERF)
target_sources(debug-common PRIVATE perf/ftrace_impl.cpp)
target_sources(debug-common
PUBLIC
FILE_SET HEADERS
FILES
perf/ftrace_impl.h
PRIVATE
perf/ftrace_impl.cpp
)
endif()

ki18n_wrap_ui(debug-common
Expand All @@ -40,6 +55,14 @@ target_link_libraries(debug-wl
)

target_sources(debug-wl
PUBLIC
FILE_SET HEADERS
FILES
console/wayland/input_device_model.h
console/wayland/input_filter.h
console/wayland/model_helpers.h
console/wayland/surface_tree_model.h
console/wayland/wayland_console.h
PRIVATE
console/wayland/input_device_model.cpp
console/wayland/wayland_console.cpp
Expand All @@ -51,5 +74,26 @@ set_target_properties(debug-wl PROPERTIES
OUTPUT_NAME "kwin-debug-wl"
)

install(TARGETS debug-common ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS debug-wl ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS debug-common
EXPORT debug-common-export
${INSTALL_TARGETS_DEFAULT_ARGS}
LIBRARY NAMELINK_SKIP
FILE_SET HEADERS DESTINATION ${KDE_INSTALL_INCLUDEDIR}/kwinft/debug
)
install(TARGETS debug-wl
EXPORT debug-wl-export
${INSTALL_TARGETS_DEFAULT_ARGS}
LIBRARY NAMELINK_SKIP
FILE_SET HEADERS DESTINATION ${KDE_INSTALL_INCLUDEDIR}/kwinft/debug
)

install(EXPORT debug-common-export
NAMESPACE kwinft::
${INSTALL_TARGETS_DEFAULT_ARGS}
DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/kwinft
)
install(EXPORT debug-wl-export
NAMESPACE kwinft::
${INSTALL_TARGETS_DEFAULT_ARGS}
DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/kwinft
)
33 changes: 31 additions & 2 deletions lib/desktop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ qt6_add_dbus_interface(
)

target_sources(desktop
PUBLIC
FILE_SET HEADERS
FILES
screen_locker_watcher.h
PRIVATE
screen_locker_watcher.cpp
${desktop_dbus_src}
Expand Down Expand Up @@ -49,6 +53,10 @@ target_link_libraries(desktop-kde
)

target_sources(desktop-kde
PUBLIC
FILE_SET HEADERS
FILES
kde/service_utils.h
PRIVATE
kde/dbus/kwin.cpp
${desktop_kde_dbus_src}
Expand Down Expand Up @@ -96,5 +104,26 @@ ecm_install_configured_files(
@ONLY DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR}
)

install(TARGETS desktop ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS desktop-kde ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(TARGETS desktop
EXPORT desktop-export
${INSTALL_TARGETS_DEFAULT_ARGS}
LIBRARY NAMELINK_SKIP
FILE_SET HEADERS DESTINATION ${KDE_INSTALL_INCLUDEDIR}/kwinft/desktop
)
install(TARGETS desktop-kde
EXPORT desktop-kde-export
${INSTALL_TARGETS_DEFAULT_ARGS}
LIBRARY NAMELINK_SKIP
FILE_SET HEADERS DESTINATION ${KDE_INSTALL_INCLUDEDIR}/kwinft/desktop
)

install(EXPORT desktop-export
NAMESPACE kwinft::
${INSTALL_TARGETS_DEFAULT_ARGS}
DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/kwinft
)
install(EXPORT desktop-kde-export
NAMESPACE kwinft::
${INSTALL_TARGETS_DEFAULT_ARGS}
DESTINATION ${KDE_INSTALL_CMAKEPACKAGEDIR}/kwinft
)
Loading

0 comments on commit 5cb9c3c

Please sign in to comment.