2 set (PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
3 set (CMAKE_PREFIX_PATH ${SEARCH_DIR_UPNP})
6 find_package (UPNP CONFIG)
9 include (FindPkgConfig)
10 pkg_check_modules (LIBUPNP libupnp)
11 unset (CMAKE_PREFIX_PATH)
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}"
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")