CMake: properly choose pkg-config or submodule sdbus

This commit is contained in:
Mihai Fufezan 2024-01-04 19:48:43 +02:00
parent c0b606460a
commit df8c154f57
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -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)