From 0c56e13e7a83599e0f6a832432e30dc08e705e50 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Fri, 21 Jun 2013 19:04:57 +0000 Subject: [PATCH] bugfix for libminiupnpc cmake script --- mk/cmake/Modules/FindMiniupnpc.cmake | 19 +++++++++++++------ source/shared_lib/CMakeLists.txt | 9 +++++---- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/mk/cmake/Modules/FindMiniupnpc.cmake b/mk/cmake/Modules/FindMiniupnpc.cmake index 77456d11..f0e07ab3 100644 --- a/mk/cmake/Modules/FindMiniupnpc.cmake +++ b/mk/cmake/Modules/FindMiniupnpc.cmake @@ -28,6 +28,8 @@ # (To distributed this file outside of CMake, substitute the full # License text for the above reference.) +message(STATUS "Looking for miniupnpc...") + if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY) # Already in cache, be silent set(MINIUPNP_FIND_QUIETLY TRUE) @@ -43,14 +45,19 @@ FIND_PATH(MINIUPNPC_INCLUDE_DIR miniupnpc.h /usr/include/miniupnpc /usr/local/include/miniupnpc) +message(STATUS "Finding miniupnpc.h result: ${MINIUPNPC_INCLUDE_DIR}") + #find_library(MINIUPNP_LIBRARY miniupnpc) -FIND_LIBRARY(MINIUPNPC_LIBRARY NAMES miniupnpc - PATHS - ${MINIUPNPC_DIR_SEARCH}/lib - /usr/${LIB_DESTINATION} - /usr/local/${LIB_DESTINATION} - /usr/lib) +IF(WANT_STATIC_LIBS) + set(MINIUPNPC_LIBRARY_NAMES ${MINIUPNPC_LIBRARY_STATIC_NAME} libminiupnpc.a) +ELSE() + set(MINIUPNPC_LIBRARY_NAMES ${MINIUPNPC_LIBRARY_DYNAMIC_NAME} libminiupnpc.so miniupnpc) +ENDIF() + +FIND_LIBRARY(MINIUPNPC_LIBRARY NAMES ${MINIUPNPC_LIBRARY_NAMES}) + +message(STATUS "Finding miniupnpc lib result: ${MINIUPNPC_LIBRARY}") if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY) set (MINIUPNP_FOUND TRUE) diff --git a/source/shared_lib/CMakeLists.txt b/source/shared_lib/CMakeLists.txt index 58661a75..4c6235a6 100644 --- a/source/shared_lib/CMakeLists.txt +++ b/source/shared_lib/CMakeLists.txt @@ -300,10 +300,11 @@ option(ENABLE_FRIBIDI "Enable FriBIDi support" ON) streflop/softfloat) ENDIF() - IF(NOT WANT_STATIC_LIBS) - MESSAGE(STATUS "*** Searching for miniupnpc since WANT_STATIC_LIBS is off ...") - FIND_PACKAGE(Miniupnpc) - ENDIF() + #IF(NOT WANT_STATIC_LIBS) + #MESSAGE(STATUS "*** Searching for miniupnpc since WANT_STATIC_LIBS is off ...") + MESSAGE(STATUS "*** Searching for miniupnpc ...") + FIND_PACKAGE(Miniupnpc) + #ENDIF() if(NOT MINIUPNP_FOUND) MESSAGE(STATUS "*** Using EMBEDDED miniupnpc since dev system does not have it... MINIUPNP_FOUND [${MINIUPNP_FOUND}]")