From df8c154f5793e71796e76004812f2a03eba67e88 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 4 Jan 2024 19:48:43 +0200 Subject: [PATCH] CMake: properly choose pkg-config or submodule sdbus --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4862183..f13e672 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ pkg_check_modules(SDBUS IMPORTED_TARGET sdbus-c++) if(NOT SDBUS_FOUND) include_directories("subprojects/sdbus-cpp/include/") add_subdirectory(subprojects/sdbus-cpp) + add_library(PkgConfig::SDBUS ALIAS sdbus-c++) endif() # same for hyprland-protocols @@ -58,7 +59,7 @@ endif() file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp") add_executable(xdg-desktop-portal-hyprland ${SRCFILES}) -target_link_libraries(xdg-desktop-portal-hyprland PRIVATE rt sdbus-c++ Threads::Threads PkgConfig::deps) +target_link_libraries(xdg-desktop-portal-hyprland PRIVATE rt PkgConfig::SDBUS Threads::Threads PkgConfig::deps) # protocols find_program(WaylandScanner NAMES wayland-scanner)