diff --git a/CMakeLists.txt b/CMakeLists.txt index d1ed1be..b1e5fb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,6 @@ add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-value -fpermissive -Wno-address-of-temporary) message(STATUS "Checking deps...") -add_subdirectory(subprojects/sdbus-cpp) add_subdirectory(hyprland-share-picker) find_package(Threads REQUIRED) @@ -38,6 +37,12 @@ find_package(Threads REQUIRED) find_package(PkgConfig REQUIRED) pkg_check_modules(deps REQUIRED IMPORTED_TARGET wayland-client wayland-protocols libpipewire-0.3 libspa-0.2 libdrm gbm hyprlang>=0.2.0) +# check whether we can find sdbus-c++ through pkg-config +pkg_check_modules(SDBUS IMPORTED_TARGET sdbus-c++) +if(NOT SDBUS_FOUND) + add_subdirectory(subprojects/sdbus-cpp) +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)