debian: fix build-deps for focal
[amule.git] / cmake / upnp.cmake
blob7c66ae17b17d128385b5cbecbb421e9961a5ea34
1 if (SEARCH_DIR_UPNP)
2         set (PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
3         set (CMAKE_PREFIX_PATH ${SEARCH_DIR_UPNP})
4 endif()
6 find_package (UPNP CONFIG)
8 if (NOT UPNP_CONFIG)
9         include (FindPkgConfig)
10         pkg_check_modules (LIBUPNP libupnp)
11         unset (CMAKE_PREFIX_PATH)
13         if (LIBUPNP_FOUND)
14                 add_library (UPNP::Shared SHARED IMPORTED)
16                 set_target_properties (UPNP::Shared PROPERTIES
17                         IMPORTED_LOCATION "${pkgcfg_lib_LIBUPNP_upnp}"
18                         INTERFACE_INCLUDE_DIRECTORIES "${LIBUPNP_INCLUDE_DIRS}"
19                         INTERFACE_LINK_LIBRARIES "${LIBUPNP_LIBRARIES}"
20                 )
21         elseif (NOT LIBUPNP_FOUND AND NOT DOWNLOAD_AND_BUILD_DEPS)
22                 set (ENABLE_UPNP FALSE)
23                 message (STATUS "lib-upnp not, disabling upnp")
24         elseif (NOT LIBUPNP_FOUND AND DOWNLOAD_AND_BUILD_DEPS)
25                 CmDaB_install ("pupnp")
26         endif()
27 endif()