Browse Source

Merge pull request #615 from AMDmi3/miniupnpc-library-detection

Find miniupnpc library as well as header
pull/618/head
orignal 8 years ago committed by GitHub
parent
commit
65c003eef8
  1. 2
      build/CMakeLists.txt
  2. 9
      build/cmake_modules/FindMiniUPnPc.cmake

2
build/CMakeLists.txt

@ -357,7 +357,7 @@ if (WITH_BINARY)
endif () endif ()
if (WITH_UPNP) if (WITH_UPNP)
target_link_libraries("${PROJECT_NAME}" "miniupnpc") target_link_libraries("${PROJECT_NAME}" "${MINIUPNPC_LIBRARY}")
endif () endif ()
# FindBoost pulls pthread for thread which is broken for static linking at least on Ubuntu 15.04 # FindBoost pulls pthread for thread which is broken for static linking at least on Ubuntu 15.04

9
build/cmake_modules/FindMiniUPnPc.cmake

@ -1,6 +1,6 @@
# - Find MINIUPNPC # - Find MINIUPNPC
if(MINIUPNPC_INCLUDE_DIR) if(MINIUPNPC_INCLUDE_DIR AND MINIUPNPC_LIBRARY)
set(MINIUPNPC_FOUND TRUE) set(MINIUPNPC_FOUND TRUE)
else() else()
@ -12,14 +12,17 @@ else()
${PROJECT_SOURCE_DIR}/../.. ${PROJECT_SOURCE_DIR}/../..
) )
if(MINIUPNPC_INCLUDE_DIR) find_library(MINIUPNPC_LIBRARY miniupnpc)
if(MINIUPNPC_INCLUDE_DIR AND MINIUPNPC_LIBRARY)
set(MINIUPNPC_FOUND TRUE) set(MINIUPNPC_FOUND TRUE)
message(STATUS "Found MiniUPnP headers: ${MINIUPNPC_INCLUDE_DIR}") message(STATUS "Found MiniUPnP headers: ${MINIUPNPC_INCLUDE_DIR}")
message(STATUS "Found MiniUPnP library: ${MINIUPNPC_LIBRARY}")
else() else()
set(MINIUPNPC_FOUND FALSE) set(MINIUPNPC_FOUND FALSE)
message(STATUS "MiniUPnP not found.") message(STATUS "MiniUPnP not found.")
endif() endif()
mark_as_advanced(MINIUPNPC_INCLUDE_DIR) mark_as_advanced(MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY)
endif() endif()

Loading…
Cancel
Save