--- mediastreamer2-4.5.22/CMakeLists.txt.orig 2021-07-09 20:43:58.295679157 +0200 +++ mediastreamer2-4.5.22/CMakeLists.txt 2021-07-09 21:46:38.291976177 +0200 @@ -81,6 +81,8 @@ option(ENABLE_PACKAGE_SOURCE "Create 'pa option(ENABLE_SRTP "Build with the SRTP transport support." YES) cmake_dependent_option(ENABLE_ZRTP "Build with ZRTP support." YES "ENABLE_SRTP" NO) +option(ENABLE_UPNP "Build with UPnP support." YES) + option(ENABLE_SOUND "Can be used to turn off all possible sound backends." YES) cmake_dependent_option(ENABLE_ALSA "Enable ALSA support." YES "ENABLE_SOUND;LINUX_OR_BSD" NO) cmake_dependent_option(ENABLE_ANDROIDSND "Enable Android sound support." NO "ENABLE_SOUND;ANDROID" NO) @@ -161,6 +163,13 @@ if(ENABLE_PCAP) find_package(PCAP QUIET) endif() +if(ENABLE_UPNP) + find_library(UPNP upnp) + if(NOT UPNP) + message(WARNING "Could not find UPNP library.") + set(ENABLE_UPNP OFF CACHE BOOL "Build with UPnP support." FORCE) + endif() +endif() if(ENABLE_SRTP) find_package(SRTP) if(NOT SRTP_FOUND) @@ -402,6 +411,11 @@ endif() if(HAVE_DLOPEN) list(APPEND LINK_LIBS dl) endif() +if(ENABLE_UPNP) + list(APPEND LINK_LIBS upnp ixml) + list(APPEND MEDIASTREAMER2_INCLUDE_DIRS /usr/include/upnp) + add_definitions(-D_GNU_SOURCE) +endif() if(ALSA_FOUND) list(APPEND LINK_LIBS asound) list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${ALSA_INCLUDE_DIRS}) --- mediastreamer2-4.5.22/src/CMakeLists.txt.orig 2021-07-09 21:45:54.498880091 +0200 +++ mediastreamer2-4.5.22/src/CMakeLists.txt 2021-07-09 21:45:58.885522993 +0200 @@ -140,6 +140,15 @@ if (APPLE) list(APPEND VOIP_SOURCE_FILES_OBJC utils/apple_utils.h utils/apple_utils.m) endif() +if(ENABLE_UPNP) + list(APPEND VOIP_SOURCE_FILES_C + upnp/upnp_igd.c + upnp/upnp_igd_private.h + upnp/upnp_igd_cmd.c + upnp/upnp_igd_utils.c + upnp/upnp_igd_utils.h + ) +endif() if(ENABLE_ALSA) list(APPEND VOIP_SOURCE_FILES_C audiofilters/alsa.c) endif()