2022-10-15 15:29:28 +00:00
|
|
|
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2022-10-15 15:29:28 +00:00
|
|
|
project (miniupnpc
|
2023-06-11 23:20:36 +00:00
|
|
|
VERSION 2.2.5
|
2022-10-15 15:29:28 +00:00
|
|
|
DESCRIPTION "UPnP IGD client lightweight library"
|
|
|
|
HOMEPAGE_URL https://miniupnp.tuxfamily.org/
|
|
|
|
LANGUAGES C)
|
2018-04-26 14:53:32 +00:00
|
|
|
|
2018-04-06 10:48:24 +00:00
|
|
|
set (MINIUPNPC_API_VERSION 17)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
option (UPNPC_BUILD_STATIC "Build static library" TRUE)
|
|
|
|
option (UPNPC_BUILD_SHARED "Build shared library" TRUE)
|
2018-04-26 14:53:32 +00:00
|
|
|
option (UPNPC_BUILD_TESTS "Build test executables" TRUE)
|
|
|
|
option (UPNPC_BUILD_SAMPLE "Build sample executables" TRUE)
|
2011-09-27 20:25:35 +00:00
|
|
|
option (NO_GETADDRINFO "Define NO_GETADDRINFO" FALSE)
|
2019-04-17 14:27:29 +00:00
|
|
|
option (UPNPC_NO_INSTALL "Disable installation" FALSE)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2018-04-26 14:53:32 +00:00
|
|
|
if (NOT UPNPC_BUILD_STATIC AND NOT UPNPC_BUILD_SHARED)
|
|
|
|
message (FATAL "Both shared and static libraries are disabled!")
|
|
|
|
endif ()
|
|
|
|
|
2020-11-24 20:20:43 +00:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2018-04-26 14:53:32 +00:00
|
|
|
# Interface library for compile definitions, flags and option
|
|
|
|
add_library(miniupnpc-private INTERFACE)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
if (NO_GETADDRINFO)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_compile_definitions(miniupnpc-private INTERFACE NO_GETADDRINFO)
|
|
|
|
endif ()
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
if (NOT WIN32)
|
2019-04-23 10:56:28 +00:00
|
|
|
target_compile_definitions(miniupnpc-private INTERFACE
|
2018-04-26 14:53:32 +00:00
|
|
|
MINIUPNPC_SET_SOCKET_TIMEOUT
|
|
|
|
_BSD_SOURCE _DEFAULT_SOURCE)
|
2022-09-15 11:51:57 +00:00
|
|
|
if (NOT APPLE AND NOT CMAKE_SYSTEM_NAME MATCHES ".*BSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
2016-06-26 12:19:18 +00:00
|
|
|
# add_definitions (-D_POSIX_C_SOURCE=200112L)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_compile_definitions(miniupnpc-private INTERFACE _XOPEN_SOURCE=600)
|
|
|
|
endif ()
|
2023-04-29 15:11:24 +00:00
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
|
|
|
target_compile_definitions(miniupnpc-private INTERFACE _NETBSD_SOURCE)
|
|
|
|
endif ()
|
2018-04-26 14:53:32 +00:00
|
|
|
else ()
|
2023-06-03 07:59:00 +00:00
|
|
|
set (MINIUPNPC_TARGET_WINDOWS_VERSION "0x0501" CACHE STRING "Minimum target Windows version as hex string") # XP or higher for getnameinfo and friends
|
|
|
|
if (MINIUPNPC_TARGET_WINDOWS_VERSION)
|
|
|
|
target_compile_definitions(miniupnpc-private INTERFACE _WIN32_WINNT=${MINIUPNPC_TARGET_WINDOWS_VERSION})
|
|
|
|
endif ()
|
2018-04-26 14:53:32 +00:00
|
|
|
endif ()
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2021-07-19 20:35:31 +00:00
|
|
|
if (APPLE)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_compile_definitions(miniupnpc-private INTERFACE _DARWIN_C_SOURCE)
|
2011-09-27 20:25:35 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
# Set compiler specific build flags
|
2018-04-26 14:53:32 +00:00
|
|
|
if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_SYSTEM_NAME STREQUAL "AmigaOS")
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
target_compile_options(miniupnpc-private INTERFACE -Wall)
|
2011-09-27 20:25:35 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-04-26 14:53:32 +00:00
|
|
|
# Suppress noise warnings
|
|
|
|
if (MSVC)
|
2022-01-04 18:32:39 +00:00
|
|
|
target_compile_definitions(miniupnpc-private INTERFACE _CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS)
|
2018-04-26 14:53:32 +00:00
|
|
|
endif()
|
|
|
|
|
2016-08-25 22:12:19 +00:00
|
|
|
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/miniupnpcstrings.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h)
|
2020-11-25 12:56:27 +00:00
|
|
|
target_include_directories(miniupnpc-private INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
set (MINIUPNPC_SOURCES
|
2021-08-12 21:39:18 +00:00
|
|
|
src/igd_desc_parse.c
|
|
|
|
src/miniupnpc.c
|
|
|
|
src/minixml.c
|
|
|
|
src/minisoap.c
|
|
|
|
src/minissdpc.c
|
|
|
|
src/miniwget.c
|
|
|
|
src/upnpcommands.c
|
|
|
|
src/upnpdev.c
|
|
|
|
src/upnpreplyparse.c
|
|
|
|
src/upnperrors.c
|
|
|
|
src/connecthostport.c
|
|
|
|
src/portlistingparse.c
|
|
|
|
src/receivedata.c
|
|
|
|
src/addr_is_reserved.c
|
2018-04-26 14:53:32 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h
|
2011-09-27 20:25:35 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if (WIN32)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_link_libraries(miniupnpc-private INTERFACE ws2_32 iphlpapi)
|
2020-10-06 22:17:16 +00:00
|
|
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
|
|
|
target_link_libraries(miniupnpc-private INTERFACE socket nsl resolv)
|
|
|
|
find_library (SOCKET_LIBRARY NAMES socket)
|
|
|
|
find_library (NSL_LIBRARY NAMES nsl)
|
|
|
|
find_library (RESOLV_LIBRARY NAMES resolv)
|
|
|
|
set (LDLIBS ${SOCKET_LIBRARY} ${NSL_LIBRARY} ${RESOLV_LIBRARY} ${LDLIBS})
|
2020-02-17 04:19:29 +00:00
|
|
|
elseif (HAIKU)
|
|
|
|
target_link_libraries(miniupnpc-private INTERFACE network)
|
|
|
|
find_library (SOCKET_LIBRARY NAMES network)
|
|
|
|
find_library (NSL_LIBRARY NAMES network)
|
|
|
|
find_library (RESOLV_LIBRARY NAMES network)
|
2021-05-22 22:23:18 +00:00
|
|
|
set (LDLIBS ${SOCKET_LIBRARY} ${NSL_LIBRARY} ${RESOLV_LIBRARY} ${LDLIBS})
|
2018-04-26 14:53:32 +00:00
|
|
|
endif ()
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (UPNPC_BUILD_STATIC)
|
2016-06-26 12:19:38 +00:00
|
|
|
add_library (libminiupnpc-static STATIC ${MINIUPNPC_SOURCES})
|
2021-05-22 22:23:18 +00:00
|
|
|
target_include_directories (libminiupnpc-static PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
|
|
$<INSTALL_INTERFACE:include/miniupnpc>)
|
2020-11-25 12:56:27 +00:00
|
|
|
if (NOT UPNPC_BUILD_SHARED)
|
|
|
|
add_library (miniupnpc::miniupnpc ALIAS libminiupnpc-static)
|
|
|
|
endif()
|
|
|
|
set_target_properties (libminiupnpc-static PROPERTIES EXPORT_NAME miniupnpc)
|
2022-04-01 15:11:28 +00:00
|
|
|
if (WIN32 AND NOT MINGW)
|
2018-05-09 10:52:41 +00:00
|
|
|
set_target_properties (libminiupnpc-static PROPERTIES OUTPUT_NAME "libminiupnpc")
|
|
|
|
else()
|
|
|
|
set_target_properties (libminiupnpc-static PROPERTIES OUTPUT_NAME "miniupnpc")
|
|
|
|
endif()
|
2018-04-26 14:53:32 +00:00
|
|
|
target_link_libraries (libminiupnpc-static PRIVATE miniupnpc-private)
|
2020-11-25 12:56:27 +00:00
|
|
|
target_include_directories(libminiupnpc-static INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_compile_definitions(libminiupnpc-static PUBLIC MINIUPNP_STATICLIB)
|
|
|
|
|
2019-04-17 14:27:29 +00:00
|
|
|
if (NOT UPNPC_NO_INSTALL)
|
2020-11-25 12:56:27 +00:00
|
|
|
install (TARGETS miniupnpc-private EXPORT miniupnpc-private)
|
|
|
|
|
|
|
|
install (EXPORT miniupnpc-private
|
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/miniupnpc"
|
|
|
|
NAMESPACE miniupnpc::)
|
|
|
|
|
2019-04-17 14:27:29 +00:00
|
|
|
install (TARGETS libminiupnpc-static
|
2020-11-25 12:56:27 +00:00
|
|
|
EXPORT libminiupnpc-static
|
2020-11-24 20:20:43 +00:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
2020-11-25 12:56:27 +00:00
|
|
|
|
|
|
|
install (EXPORT libminiupnpc-static
|
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/miniupnpc"
|
|
|
|
NAMESPACE miniupnpc::)
|
2019-04-17 14:27:29 +00:00
|
|
|
endif()
|
2018-04-26 14:53:32 +00:00
|
|
|
|
|
|
|
if (UPNPC_BUILD_SAMPLE)
|
2021-08-12 21:39:18 +00:00
|
|
|
add_executable (upnpc-static src/upnpc.c)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_link_libraries (upnpc-static PRIVATE libminiupnpc-static)
|
|
|
|
target_include_directories(upnpc-static PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
2023-01-04 21:33:12 +00:00
|
|
|
if (NOT UPNPC_NO_INSTALL)
|
|
|
|
install (TARGETS upnpc-static
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
2018-04-26 14:53:32 +00:00
|
|
|
endif ()
|
2023-06-15 22:40:35 +00:00
|
|
|
|
|
|
|
add_executable (upnp-listdevices-static src/listdevices.c)
|
|
|
|
target_link_libraries (upnp-listdevices-static PRIVATE libminiupnpc-static)
|
|
|
|
target_include_directories(upnp-listdevices-static PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
if (NOT UPNPC_NO_INSTALL)
|
|
|
|
install (TARGETS upnp-listdevices-static
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
2018-04-26 14:53:32 +00:00
|
|
|
endif ()
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
if (UPNPC_BUILD_SHARED)
|
2016-06-26 12:19:38 +00:00
|
|
|
add_library (libminiupnpc-shared SHARED ${MINIUPNPC_SOURCES})
|
2021-05-22 22:23:18 +00:00
|
|
|
target_include_directories (libminiupnpc-shared PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
|
|
$<INSTALL_INTERFACE:include/miniupnpc>)
|
2020-11-25 12:56:27 +00:00
|
|
|
add_library (miniupnpc::miniupnpc ALIAS libminiupnpc-shared)
|
|
|
|
set_target_properties (libminiupnpc-shared PROPERTIES EXPORT_NAME miniupnpc)
|
2016-06-26 12:19:38 +00:00
|
|
|
set_target_properties (libminiupnpc-shared PROPERTIES OUTPUT_NAME "miniupnpc")
|
2022-10-15 15:29:28 +00:00
|
|
|
set_target_properties (libminiupnpc-shared PROPERTIES VERSION ${PROJECT_VERSION})
|
2016-06-26 12:19:38 +00:00
|
|
|
set_target_properties (libminiupnpc-shared PROPERTIES SOVERSION ${MINIUPNPC_API_VERSION})
|
2018-04-26 14:53:32 +00:00
|
|
|
target_link_libraries (libminiupnpc-shared PRIVATE miniupnpc-private)
|
|
|
|
target_compile_definitions(libminiupnpc-shared PRIVATE MINIUPNP_EXPORTS)
|
|
|
|
|
2020-11-25 12:56:27 +00:00
|
|
|
target_include_directories(libminiupnpc-shared INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
2018-04-26 14:53:32 +00:00
|
|
|
if (WIN32)
|
|
|
|
target_link_libraries(libminiupnpc-shared INTERFACE ws2_32 iphlpapi)
|
|
|
|
endif()
|
|
|
|
|
2019-04-17 14:27:29 +00:00
|
|
|
if (NOT UPNPC_NO_INSTALL)
|
|
|
|
install (TARGETS libminiupnpc-shared
|
2020-11-25 12:56:27 +00:00
|
|
|
EXPORT libminiupnpc-shared
|
2020-11-24 20:20:43 +00:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
2020-11-25 12:56:27 +00:00
|
|
|
|
|
|
|
install (EXPORT libminiupnpc-shared
|
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/miniupnpc"
|
|
|
|
NAMESPACE miniupnpc::)
|
2019-04-17 14:27:29 +00:00
|
|
|
endif()
|
2018-04-26 14:53:32 +00:00
|
|
|
|
|
|
|
if (UPNPC_BUILD_SAMPLE)
|
2021-08-12 21:39:18 +00:00
|
|
|
add_executable (upnpc-shared src/upnpc.c)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_link_libraries (upnpc-shared PRIVATE libminiupnpc-shared)
|
|
|
|
target_include_directories(upnpc-shared PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
2023-01-04 21:33:12 +00:00
|
|
|
if (NOT UPNPC_NO_INSTALL)
|
|
|
|
install (TARGETS upnpc-shared
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
2018-04-26 14:53:32 +00:00
|
|
|
endif ()
|
2019-04-21 20:17:50 +00:00
|
|
|
|
2023-06-15 22:40:35 +00:00
|
|
|
add_executable (upnp-listdevices-shared src/listdevices.c)
|
|
|
|
target_link_libraries (upnp-listdevices-shared PRIVATE libminiupnpc-shared)
|
|
|
|
target_include_directories(upnp-listdevices-shared PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
2023-01-04 21:33:12 +00:00
|
|
|
if (NOT UPNPC_NO_INSTALL)
|
2023-06-15 22:40:35 +00:00
|
|
|
install (TARGETS upnp-listdevices-shared
|
2023-01-04 21:33:12 +00:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
endif()
|
2018-04-26 14:53:32 +00:00
|
|
|
endif ()
|
2011-09-27 20:25:35 +00:00
|
|
|
|
|
|
|
if (UPNPC_BUILD_TESTS)
|
2018-04-26 14:53:32 +00:00
|
|
|
add_library(miniupnpc-tests INTERFACE)
|
|
|
|
target_link_libraries(miniupnpc-tests INTERFACE miniupnpc-private)
|
|
|
|
target_compile_definitions(miniupnpc-tests INTERFACE MINIUPNP_STATICLIB)
|
|
|
|
|
2021-08-12 21:39:18 +00:00
|
|
|
add_executable (testminixml src/testminixml.c src/minixml.c src/igd_desc_parse.c)
|
2021-05-22 22:23:18 +00:00
|
|
|
target_include_directories (testminixml PRIVATE
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_link_libraries (testminixml PRIVATE miniupnpc-tests)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2021-08-12 21:39:18 +00:00
|
|
|
add_executable (minixmlvalid src/minixmlvalid.c src/minixml.c)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_link_libraries (minixmlvalid PRIVATE miniupnpc-tests)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2021-08-12 21:39:18 +00:00
|
|
|
add_executable (testupnpreplyparse src/testupnpreplyparse.c
|
|
|
|
src/minixml.c src/upnpreplyparse.c)
|
2021-05-22 22:23:18 +00:00
|
|
|
target_include_directories (testupnpreplyparse PRIVATE
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_link_libraries (testupnpreplyparse PRIVATE miniupnpc-tests)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2021-08-12 21:39:18 +00:00
|
|
|
add_executable (testigddescparse src/testigddescparse.c
|
|
|
|
src/igd_desc_parse.c src/minixml.c src/miniupnpc.c src/miniwget.c src/minissdpc.c
|
|
|
|
src/upnpcommands.c src/upnpreplyparse.c src/minisoap.c src/connecthostport.c
|
|
|
|
src/portlistingparse.c src/receivedata.c src/addr_is_reserved.c
|
2011-09-27 20:25:35 +00:00
|
|
|
)
|
2021-05-22 22:23:18 +00:00
|
|
|
target_include_directories (testigddescparse PRIVATE
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_link_libraries (testigddescparse PRIVATE miniupnpc-tests)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2021-08-12 21:39:18 +00:00
|
|
|
add_executable (testminiwget src/testminiwget.c
|
|
|
|
src/miniwget.c src/miniupnpc.c src/minisoap.c src/upnpcommands.c src/minissdpc.c
|
|
|
|
src/upnpreplyparse.c src/minixml.c src/igd_desc_parse.c src/connecthostport.c
|
|
|
|
src/portlistingparse.c src/receivedata.c src/addr_is_reserved.c
|
2011-09-27 20:25:35 +00:00
|
|
|
)
|
2021-05-22 22:23:18 +00:00
|
|
|
target_include_directories (testminiwget PRIVATE
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
|
2018-04-26 14:53:32 +00:00
|
|
|
target_link_libraries (testminiwget PRIVATE miniupnpc-tests)
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2021-08-12 21:39:18 +00:00
|
|
|
add_executable (testaddr_is_reserved src/testaddr_is_reserved.c
|
|
|
|
src/addr_is_reserved.c
|
2021-05-21 22:09:09 +00:00
|
|
|
)
|
2020-09-23 22:08:55 +00:00
|
|
|
target_link_libraries (testaddr_is_reserved PRIVATE miniupnpc-tests)
|
|
|
|
|
2022-10-21 20:47:21 +00:00
|
|
|
add_executable (testportlistingparse src/testportlistingparse.c
|
|
|
|
src/minixml.c src/portlistingparse.c)
|
|
|
|
target_include_directories (testportlistingparse PRIVATE
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
|
|
|
|
target_link_libraries (testportlistingparse PRIVATE miniupnpc-tests)
|
|
|
|
|
2023-06-12 22:37:03 +00:00
|
|
|
if (NOT WIN32)
|
|
|
|
add_executable (minihttptestserver src/minihttptestserver.c)
|
|
|
|
endif()
|
2022-10-21 20:47:21 +00:00
|
|
|
|
2011-09-27 20:25:35 +00:00
|
|
|
# set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} testminixml minixmlvalid testupnpreplyparse testigddescparse testminiwget)
|
2022-10-21 20:47:21 +00:00
|
|
|
include(CTest)
|
|
|
|
add_test(NAME validateminixml
|
|
|
|
COMMAND minixmlvalid)
|
|
|
|
add_test(NAME validateminiwget
|
|
|
|
COMMAND ${CMAKE_SOURCE_DIR}/testminiwget.sh)
|
2023-06-12 22:37:03 +00:00
|
|
|
if (NOT WIN32)
|
|
|
|
set_property(TEST validateminiwget
|
|
|
|
PROPERTY ENVIRONMENT
|
|
|
|
TESTSERVER=${CMAKE_BINARY_DIR}/minihttptestserver
|
|
|
|
TESTMINIWGET=${CMAKE_BINARY_DIR}/testminiwget)
|
|
|
|
endif()
|
2022-10-21 20:47:21 +00:00
|
|
|
add_test(NAME validateupnpreplyparse
|
|
|
|
COMMAND ${CMAKE_SOURCE_DIR}/testupnpreplyparse.sh
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
|
|
|
set_property(TEST validateupnpreplyparse
|
|
|
|
PROPERTY ENVIRONMENT
|
|
|
|
TESTUPNPREPLYPARSE=${CMAKE_BINARY_DIR}/testupnpreplyparse)
|
|
|
|
add_test(NAME validateportlistingparse
|
|
|
|
COMMAND testportlistingparse)
|
|
|
|
add_test(NAME validateigddescparse1
|
|
|
|
COMMAND testigddescparse new_LiveBox_desc.xml new_LiveBox_desc.values
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/testdesc)
|
|
|
|
add_test(NAME validateigddescparse2
|
|
|
|
COMMAND testigddescparse linksys_WAG200G_desc.xml linksys_WAG200G_desc.values
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/testdesc)
|
|
|
|
add_test(NAME validateaddr_is_reserved
|
|
|
|
COMMAND testaddr_is_reserved)
|
|
|
|
|
2018-04-26 14:53:32 +00:00
|
|
|
endif ()
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2022-01-22 23:45:11 +00:00
|
|
|
configure_file(miniupnpc.pc.in miniupnpc.pc @ONLY)
|
|
|
|
|
2019-04-17 14:27:29 +00:00
|
|
|
if (NOT UPNPC_NO_INSTALL)
|
|
|
|
install (FILES
|
2021-09-30 14:00:27 +00:00
|
|
|
include/miniupnpc.h
|
|
|
|
include/miniwget.h
|
|
|
|
include/upnpcommands.h
|
|
|
|
include/igd_desc_parse.h
|
|
|
|
include/upnpreplyparse.h
|
|
|
|
include/upnperrors.h
|
|
|
|
include/upnpdev.h
|
|
|
|
include/miniupnpctypes.h
|
|
|
|
include/portlistingparse.h
|
|
|
|
include/miniupnpc_declspec.h
|
2023-01-04 21:49:35 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/miniupnpc
|
2019-04-17 14:27:29 +00:00
|
|
|
)
|
2020-11-25 12:56:27 +00:00
|
|
|
|
|
|
|
install(FILES miniupnpc-config.cmake
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/miniupnpc
|
|
|
|
)
|
2022-01-22 23:45:11 +00:00
|
|
|
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/miniupnpc.pc
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
|
|
|
)
|
2023-01-04 21:42:05 +00:00
|
|
|
|
|
|
|
install(FILES man3/miniupnpc.3
|
|
|
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
|
|
|
|
)
|
2023-01-04 21:48:52 +00:00
|
|
|
|
|
|
|
install(FILES external-ip.sh
|
|
|
|
TYPE BIN
|
|
|
|
)
|
2019-04-17 14:27:29 +00:00
|
|
|
endif()
|
2011-09-27 20:25:35 +00:00
|
|
|
|
2021-05-21 22:09:09 +00:00
|
|
|
# vim: ts=2:sw=2:expandtab
|