Skip to content

Commit 959843e

Browse files
committed
Find miniupnpc library as well as header
1 parent 3d066ea commit 959843e

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

build/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ if (WITH_BINARY)
357357
endif ()
358358

359359
if (WITH_UPNP)
360-
target_link_libraries("${PROJECT_NAME}" "miniupnpc")
360+
target_link_libraries("${PROJECT_NAME}" "${MINIUPNPC_LIBRARY}")
361361
endif ()
362362

363363
# FindBoost pulls pthread for thread which is broken for static linking at least on Ubuntu 15.04
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# - Find MINIUPNPC
22

3-
if(MINIUPNPC_INCLUDE_DIR)
3+
if(MINIUPNPC_INCLUDE_DIR AND MINIUPNPC_LIBRARY)
44
set(MINIUPNPC_FOUND TRUE)
55

66
else()
@@ -11,15 +11,18 @@ else()
1111
$ENV{SystemDrive}
1212
${PROJECT_SOURCE_DIR}/../..
1313
)
14-
15-
if(MINIUPNPC_INCLUDE_DIR)
14+
15+
find_library(MINIUPNPC_LIBRARY miniupnpc)
16+
17+
if(MINIUPNPC_INCLUDE_DIR AND MINIUPNPC_LIBRARY)
1618
set(MINIUPNPC_FOUND TRUE)
1719
message(STATUS "Found MiniUPnP headers: ${MINIUPNPC_INCLUDE_DIR}")
20+
message(STATUS "Found MiniUPnP library: ${MINIUPNPC_LIBRARY}")
1821
else()
1922
set(MINIUPNPC_FOUND FALSE)
2023
message(STATUS "MiniUPnP not found.")
2124
endif()
2225

23-
mark_as_advanced(MINIUPNPC_INCLUDE_DIR)
26+
mark_as_advanced(MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY)
2427

2528
endif()

0 commit comments

Comments
 (0)