2020-12-27 17:56:33 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8.12)
|
2013-07-09 00:13:02 +00:00
|
|
|
|
|
|
|
project(miniupnpc C)
|
2015-10-14 03:21:28 +00:00
|
|
|
set(MINIUPNPC_VERSION 1.9)
|
|
|
|
set(MINIUPNPC_API_VERSION 14)
|
2013-07-09 00:13:02 +00:00
|
|
|
|
|
|
|
if(UNIX)
|
|
|
|
add_definitions(-DMINIUPNPC_SET_SOCKET_TIMEOUT)
|
|
|
|
add_definitions(-D_BSD_SOURCE -D_POSIX_C_SOURCE=1)
|
|
|
|
elseif(WIN32)
|
|
|
|
add_definitions(-D_WIN32_WINNT=0x0501)
|
|
|
|
find_library(WINSOCK2_LIBRARY NAMES ws2_32 WS2_32 Ws2_32)
|
|
|
|
find_library(IPHLPAPI_LIBRARY NAMES iphlpapi)
|
|
|
|
set(LDLIBS ${WINSOCK2_LIBRARY} ${IPHLPAPI_LIBRARY} ${LDLIBS})
|
|
|
|
endif()
|
|
|
|
|
2015-01-03 12:17:57 +00:00
|
|
|
if(APPLE)
|
2013-07-09 00:13:02 +00:00
|
|
|
add_definitions(-DMACOSX -D_DARWIN_C_SOURCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(SRCS src/igd_desc_parse.c
|
|
|
|
src/miniupnpc.c
|
|
|
|
src/minixml.c
|
|
|
|
src/minisoap.c
|
2015-10-14 03:21:28 +00:00
|
|
|
src/minissdpc.c
|
2013-07-09 00:13:02 +00:00
|
|
|
src/miniwget.c
|
|
|
|
src/upnpcommands.c
|
2015-10-14 03:21:28 +00:00
|
|
|
src/upnpdev.c
|
2013-07-09 00:13:02 +00:00
|
|
|
src/upnpreplyparse.c
|
|
|
|
src/upnperrors.c
|
|
|
|
src/connecthostport.c
|
|
|
|
src/portlistingparse.c
|
|
|
|
src/receivedata.c)
|
|
|
|
|
|
|
|
add_library(miniupnpc STATIC ${SRCS})
|
2024-03-19 06:08:54 +00:00
|
|
|
dolphin_disable_warnings(miniupnpc)
|
2017-08-14 22:13:12 +00:00
|
|
|
target_include_directories(miniupnpc PUBLIC src)
|
2017-08-17 20:14:20 +00:00
|
|
|
|
|
|
|
add_library(Miniupnpc::miniupnpc ALIAS miniupnpc)
|