diff options
| author | Scott Mansell <phiren@gmail.com> | 2015-11-02 18:00:06 +1300 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2015-11-02 18:00:06 +1300 |
| commit | 4fa3ddcbf65c625ff496ccdd0fea9652d21b625c (patch) | |
| tree | 7c12bb7360b3807b9bcce74cafbdf9d966919191 | |
| parent | bd20dd39620ca2903ea3ccb71af3a14cfe3c7db8 (diff) | |
CMake: Fix FindMiniupnpc for ubuntu 14.04
Ubuntu 14.04 has miniupnpc 1.6.3
REGEX was failing because the string was empty, causing cmake to
error and not generate a Makefile.
This allows systems with older versions of miniupnpc to fall back
to the statically linked version in externals.
| -rw-r--r-- | CMakeTests/FindMiniupnpc.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/CMakeTests/FindMiniupnpc.cmake b/CMakeTests/FindMiniupnpc.cmake index dd01e3ef72..79b00c0621 100644 --- a/CMakeTests/FindMiniupnpc.cmake +++ b/CMakeTests/FindMiniupnpc.cmake @@ -6,7 +6,9 @@ find_library(MINIUPNPC_LIBRARY miniupnpc) if(MINIUPNPC_INCLUDE_DIR) file(STRINGS "${MINIUPNPC_INCLUDE_DIR}/miniupnpc.h" MINIUPNPC_API_VERSION_STR REGEX "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+[0-9]+") - string(REGEX REPLACE "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+([0-9]+)" "\\1" MINIUPNPC_API_VERSION ${MINIUPNPC_API_VERSION_STR}) + if(MINIUPNPC_API_VERSION_STR) + string(REGEX REPLACE "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+([0-9]+)" "\\1" MINIUPNPC_API_VERSION ${MINIUPNPC_API_VERSION_STR}) + endif() endif() include(FindPackageHandleStandardArgs) |
