Skip to content

Commit

Permalink
CMake: sdbus through pkg-config, fallback to subproject
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Jan 3, 2024
1 parent bd11007 commit f46cff1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ 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)

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)
Expand Down

0 comments on commit f46cff1

Please sign in to comment.