Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions tools/upnp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,24 @@ find_package(PkgConfig REQUIRED)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(LIBSOUP REQUIRED libsoup-2.4)
pkg_check_modules(GSSDP REQUIRED gssdp-1.2)
pkg_check_modules(GUPNP gupnp-1.2)
pkg_check_modules(LIBSOUP3 libsoup-3.0)
pkg_check_modules(GSSDP16 gssdp-1.6)
pkg_check_modules(GUPNP16 gupnp-1.6)

if (NOT GUPNP_FOUND)
pkg_check_modules(GUPNP REQUIRED gupnp-1.0)
add_definitions(-DGUPNP_1_0)
if (LIBSOUP3_FOUND AND GSSDP16_FOUND AND GUPNP16_FOUND)
# Use 3.0 stack with REQUIRED to set final variables
pkg_check_modules(LIBSOUP REQUIRED libsoup-3.0)
pkg_check_modules(GSSDP REQUIRED gssdp-1.6)
pkg_check_modules(GUPNP REQUIRED gupnp-1.6)
else ()
# Fallback to 2.4 stack
pkg_check_modules(LIBSOUP REQUIRED libsoup-2.4)
pkg_check_modules(GSSDP REQUIRED gssdp-1.2)
pkg_check_modules(GUPNP gupnp-1.2)
if (NOT GUPNP_FOUND)
pkg_check_modules(GUPNP REQUIRED gupnp-1.0)
add_definitions(-DGUPNP_1_0)
endif ()
endif ()

if (USE_TELEMETRY)
Expand Down