diff options
author | fluffypony <ric@spagni.net> | 2014-09-10 18:14:57 +0200 |
---|---|---|
committer | fluffypony <ric@spagni.net> | 2014-09-10 18:14:57 +0200 |
commit | 7d01dad8f4fdef18936977defab18c13dc32d19b (patch) | |
tree | a8f58160680e1326b1f6a6fbad8d0a60f2e00f84 /external/CMakeLists.txt | |
parent | miniupnpc changes for freebsd (diff) | |
download | monero-7d01dad8f4fdef18936977defab18c13dc32d19b.tar.xz |
use external miniupnpc if available
Diffstat (limited to '')
-rwxr-xr-x | external/CMakeLists.txt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 547fb7e96..481fbe9db 100755 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -1,8 +1,18 @@ -if(NOT FREEBSD) +if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + include(FindMiniupnpc) +endif() + +if(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER) + message(STATUS "Using shared miniupnpc") + include_directories(${MINIUPNP_INCLUDE_DIR}) + set(UPNP_LIBRARIES "miniupnpc") +else() + message(STATUS "Using static miniupnpc from external") + add_subdirectory(miniupnpc) + 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") - add_subdirectory(miniupnpc) set_property(TARGET upnpc-static PROPERTY FOLDER "external") if(MSVC) @@ -10,4 +20,6 @@ if(NOT FREEBSD) elseif(NOT MSVC) set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") endif() -endif()
\ No newline at end of file + + set(UPNP_LIBRARIES "upnpc-static") +endif() |