Skip to content

Commit

Permalink
Find miniupnpc library as well as header
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Aug 19, 2016
1 parent 3d066ea commit 959843e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ if (WITH_BINARY)
endif ()

if (WITH_UPNP)
target_link_libraries("${PROJECT_NAME}" "miniupnpc")
target_link_libraries("${PROJECT_NAME}" "${MINIUPNPC_LIBRARY}")
endif ()

# FindBoost pulls pthread for thread which is broken for static linking at least on Ubuntu 15.04
Expand Down
11 changes: 7 additions & 4 deletions build/cmake_modules/FindMiniUPnPc.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# - Find MINIUPNPC

if(MINIUPNPC_INCLUDE_DIR)
if(MINIUPNPC_INCLUDE_DIR AND MINIUPNPC_LIBRARY)
set(MINIUPNPC_FOUND TRUE)

else()
Expand All @@ -11,15 +11,18 @@ else()
$ENV{SystemDrive}
${PROJECT_SOURCE_DIR}/../..
)

if(MINIUPNPC_INCLUDE_DIR)

find_library(MINIUPNPC_LIBRARY miniupnpc)

if(MINIUPNPC_INCLUDE_DIR AND MINIUPNPC_LIBRARY)
set(MINIUPNPC_FOUND TRUE)
message(STATUS "Found MiniUPnP headers: ${MINIUPNPC_INCLUDE_DIR}")
message(STATUS "Found MiniUPnP library: ${MINIUPNPC_LIBRARY}")
else()
set(MINIUPNPC_FOUND FALSE)
message(STATUS "MiniUPnP not found.")
endif()

mark_as_advanced(MINIUPNPC_INCLUDE_DIR)
mark_as_advanced(MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY)

endif()

0 comments on commit 959843e

Please sign in to comment.