bugfix for libminiupnpc cmake script

This commit is contained in:
Mark Vejvoda 2013-06-21 19:04:57 +00:00
parent 0385e6f5f8
commit 0c56e13e7a
2 changed files with 18 additions and 10 deletions

View File

@ -28,6 +28,8 @@
# (To distributed this file outside of CMake, substitute the full # (To distributed this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
message(STATUS "Looking for miniupnpc...")
if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY) if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY)
# Already in cache, be silent # Already in cache, be silent
set(MINIUPNP_FIND_QUIETLY TRUE) set(MINIUPNP_FIND_QUIETLY TRUE)
@ -43,14 +45,19 @@ FIND_PATH(MINIUPNPC_INCLUDE_DIR miniupnpc.h
/usr/include/miniupnpc /usr/include/miniupnpc
/usr/local/include/miniupnpc) /usr/local/include/miniupnpc)
message(STATUS "Finding miniupnpc.h result: ${MINIUPNPC_INCLUDE_DIR}")
#find_library(MINIUPNP_LIBRARY miniupnpc) #find_library(MINIUPNP_LIBRARY miniupnpc)
FIND_LIBRARY(MINIUPNPC_LIBRARY NAMES miniupnpc IF(WANT_STATIC_LIBS)
PATHS set(MINIUPNPC_LIBRARY_NAMES ${MINIUPNPC_LIBRARY_STATIC_NAME} libminiupnpc.a)
${MINIUPNPC_DIR_SEARCH}/lib ELSE()
/usr/${LIB_DESTINATION} set(MINIUPNPC_LIBRARY_NAMES ${MINIUPNPC_LIBRARY_DYNAMIC_NAME} libminiupnpc.so miniupnpc)
/usr/local/${LIB_DESTINATION} ENDIF()
/usr/lib)
FIND_LIBRARY(MINIUPNPC_LIBRARY NAMES ${MINIUPNPC_LIBRARY_NAMES})
message(STATUS "Finding miniupnpc lib result: ${MINIUPNPC_LIBRARY}")
if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY) if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY)
set (MINIUPNP_FOUND TRUE) set (MINIUPNP_FOUND TRUE)

View File

@ -300,10 +300,11 @@ option(ENABLE_FRIBIDI "Enable FriBIDi support" ON)
streflop/softfloat) streflop/softfloat)
ENDIF() ENDIF()
IF(NOT WANT_STATIC_LIBS) #IF(NOT WANT_STATIC_LIBS)
MESSAGE(STATUS "*** Searching for miniupnpc since WANT_STATIC_LIBS is off ...") #MESSAGE(STATUS "*** Searching for miniupnpc since WANT_STATIC_LIBS is off ...")
FIND_PACKAGE(Miniupnpc) MESSAGE(STATUS "*** Searching for miniupnpc ...")
ENDIF() FIND_PACKAGE(Miniupnpc)
#ENDIF()
if(NOT MINIUPNP_FOUND) if(NOT MINIUPNP_FOUND)
MESSAGE(STATUS "*** Using EMBEDDED miniupnpc since dev system does not have it... MINIUPNP_FOUND [${MINIUPNP_FOUND}]") MESSAGE(STATUS "*** Using EMBEDDED miniupnpc since dev system does not have it... MINIUPNP_FOUND [${MINIUPNP_FOUND}]")