On linux check for a new enough system version of miniupnpc. Fall back

to building the version in the externals if it is not available.
This commit is contained in:
Glenn Rice
2013-07-09 22:07:27 -05:00
parent 44db305602
commit 1f6b70bf87
2 changed files with 201 additions and 14 deletions
+22 -14
View File
@@ -523,17 +523,17 @@ if(NOT ANDROID)
else(SDL2_FOUND)
# SDL2 not found, try SDL
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include(FindSDL OPTIONAL)
endif()
if(SDL_FOUND)
message("Using shared SDL")
include_directories(${SDL_INCLUDE_DIR})
else(SDL_FOUND)
# TODO: Use the prebuilt one on Windows
message("Using static SDL from Externals")
include_directories(Externals/SDL/SDL Externals/SDL Externals/SDL/include)
add_subdirectory(Externals/SDL)
endif(SDL_FOUND)
include(FindSDL OPTIONAL)
endif()
if(SDL_FOUND)
message("Using shared SDL")
include_directories(${SDL_INCLUDE_DIR})
else(SDL_FOUND)
# TODO: Use the prebuilt one on Windows
message("Using static SDL from Externals")
include_directories(Externals/SDL/SDL Externals/SDL Externals/SDL/include)
add_subdirectory(Externals/SDL)
endif(SDL_FOUND)
endif(SDL2_FOUND)
endif()
@@ -552,9 +552,17 @@ else()
endif()
if(USE_UPNP)
message("Using static MiniUPnP client from Externals")
add_subdirectory(Externals/miniupnpc)
include_directories(Externals/miniupnpc/src)
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT ANDROID)
include(FindMiniupnpc)
endif()
if(MINIUPNP_FOUND AND NOT MINIUPNPC_VERSION_PRE1_7)
message("Using shared miniupnpc")
include_directories(${MINIUPNP_INCLUDE_DIR})
else()
message("Using static miniupnpc from Externals")
add_subdirectory(Externals/miniupnpc)
include_directories(Externals/miniupnpc/src)
endif()
add_definitions(-DUSE_UPNP)
endif()