2014-09-10 16:14:57 +00:00
|
|
|
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
include(FindMiniupnpc)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER)
|
2014-09-10 18:01:30 +00:00
|
|
|
message(STATUS "Using shared miniupnpc found at ${MINIUPNP_INCLUDE_DIR}")
|
2014-09-10 16:14:57 +00:00
|
|
|
include_directories(${MINIUPNP_INCLUDE_DIR})
|
|
|
|
else()
|
|
|
|
message(STATUS "Using static miniupnpc from external")
|
|
|
|
|
2014-09-09 12:03:42 +00:00
|
|
|
set(UPNPC_BUILD_STATIC ON CACHE BOOL "Build static library")
|
|
|
|
set(UPNPC_BUILD_SHARED OFF CACHE BOOL "Build shared library")
|
|
|
|
set(UPNPC_BUILD_TESTS OFF CACHE BOOL "Build test executables")
|
2014-09-10 18:01:30 +00:00
|
|
|
add_subdirectory(miniupnpc)
|
2014-04-09 12:14:35 +00:00
|
|
|
|
2014-09-09 12:03:42 +00:00
|
|
|
set_property(TARGET upnpc-static PROPERTY FOLDER "external")
|
|
|
|
if(MSVC)
|
|
|
|
set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267")
|
|
|
|
elseif(NOT MSVC)
|
|
|
|
set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value")
|
|
|
|
endif()
|
2014-09-10 16:14:57 +00:00
|
|
|
endif()
|