Skip to content

Commit 67a561e

Browse files
lemirepMiKom
authored andcommitted
Update cmake.in to reference exported dependencies
Those are PRIVATE libraries we link against but when consuming the KDUtils or KDGui package we need to have provide a way to find those targets. Change-Id: I66dfd06a813af212fef70f5c33c091c03a9d9193
1 parent 0308462 commit 67a561e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/KDGui/cmake/KDGuiConfig.cmake.in

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,21 @@
1111
include(CMakeFindDependencyMacro)
1212
find_dependency(KDFoundation)
1313

14+
# Find Wayland dependencies if needed (KDGui may link against them on Linux)
15+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
16+
# Wayland in vcpkg is found via PkgConfig, not CMake config
17+
find_dependency(PkgConfig)
18+
if(PkgConfig_FOUND)
19+
pkg_check_modules(WAYLAND_CLIENT QUIET wayland-client IMPORTED_TARGET)
20+
pkg_check_modules(WAYLAND_CURSOR QUIET wayland-cursor IMPORTED_TARGET)
21+
# Create aliases to match the expected target names
22+
if(WAYLAND_CLIENT_FOUND AND TARGET PkgConfig::WAYLAND_CLIENT)
23+
add_library(Wayland::Client ALIAS PkgConfig::WAYLAND_CLIENT)
24+
endif()
25+
if(WAYLAND_CURSOR_FOUND AND TARGET PkgConfig::WAYLAND_CURSOR)
26+
add_library(Wayland::Cursor ALIAS PkgConfig::WAYLAND_CURSOR)
27+
endif()
28+
endif()
29+
endif()
30+
1431
include("${CMAKE_CURRENT_LIST_DIR}/KDGuiConfigTargets.cmake")

src/KDUtils/cmake/KDUtilsConfig.cmake.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010

1111
include(CMakeFindDependencyMacro)
1212
find_dependency(spdlog)
13+
find_dependency(mio)
14+
find_dependency(whereami)
1315

1416
include("${CMAKE_CURRENT_LIST_DIR}/KDUtilsConfigTargets.cmake")

0 commit comments

Comments
 (0)