Require enet >= 1.3.4.

It's needed for enet_peer_ping_interval()
This commit is contained in:
Deve 2018-07-09 22:33:14 +02:00
parent 68d43734cd
commit c76f48c701
2 changed files with 13 additions and 56 deletions

View File

@ -132,22 +132,30 @@ if(UNIX OR MINGW)
endif() endif()
endif() endif()
if(UNIX AND NOT APPLE)
find_package(PkgConfig REQUIRED)
if(NOT PKGCONFIG_FOUND)
message(FATAL_ERROR "Pkg-config not found.")
endif()
endif()
# Build the Bullet physics library # Build the Bullet physics library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet")
include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src") include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src")
# Find system ENet library or build it if missing # Find system ENet library or build it if missing
if((UNIX AND NOT APPLE) AND USE_SYSTEM_ENET) if((UNIX AND NOT APPLE) AND USE_SYSTEM_ENET)
find_package(ENet) pkg_check_modules(ENET libenet>=1.3.4)
endif() endif()
if(ENET_FOUND) if(ENET_FOUND)
include_directories(${ENet_INCLUDE_DIRS}) include_directories(${ENET_INCLUDE_DIRS})
else() else()
# Fallback to built-in version # Fallback to built-in version
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/enet") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/enet")
include_directories("${PROJECT_SOURCE_DIR}/lib/enet/include") include_directories("${PROJECT_SOURCE_DIR}/lib/enet/include")
set(ENet_LIBRARIES "enet") set(ENET_LIBRARIES "enet")
endif() endif()
# Find system GLEW library or build it if missing # Find system GLEW library or build it if missing
@ -160,10 +168,7 @@ if (APPLE)
elseif(NOT USE_GLES2 AND NOT SERVER_ONLY) elseif(NOT USE_GLES2 AND NOT SERVER_ONLY)
add_definitions(-DGLEW_NO_GLU) add_definitions(-DGLEW_NO_GLU)
if((UNIX AND NOT APPLE) AND USE_SYSTEM_GLEW) if((UNIX AND NOT APPLE) AND USE_SYSTEM_GLEW)
find_package(PkgConfig) pkg_check_modules(GLEW glew>=2.1)
if(PKGCONFIG_FOUND)
pkg_check_modules(GLEW glew>=2.1)
endif()
endif() endif()
if(GLEW_FOUND) if(GLEW_FOUND)
@ -474,7 +479,7 @@ target_link_libraries(supertuxkart
bulletdynamics bulletdynamics
bulletcollision bulletcollision
bulletmath bulletmath
${ENet_LIBRARIES} ${ENET_LIBRARIES}
stkirrlicht stkirrlicht
${Angelscript_LIBRARIES} ${Angelscript_LIBRARIES}
${CURL_LIBRARIES} ${CURL_LIBRARIES}

View File

@ -1,48 +0,0 @@
# - Try to find enet
# Once done this will define
#
# ENET_FOUND - system has enet
# ENet_INCLUDE_DIRS - the enet include directory
# ENet_LIBRARIES - the libraries needed to use enet
#
# $ENETDIR is an environment variable used for finding enet.
#
# Borrowed from The Mana World
# http://themanaworld.org/
#
# Several changes and additions by Fabian 'x3n' Landau
# Lots of simplifications by Adrian Friedli
# > www.orxonox.net <
FIND_PATH(ENet_INCLUDE_DIRS enet/enet.h
PATHS
$ENV{ENETDIR}
/usr/local
/usr
PATH_SUFFIXES include
)
FIND_LIBRARY(ENet_LIBRARY
NAMES enet
PATHS
$ENV{ENETDIR}
/usr/local
/usr
PATH_SUFFIXES lib
)
# handle the QUIETLY and REQUIRED arguments and set ENET_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ENet DEFAULT_MSG ENet_LIBRARY ENet_INCLUDE_DIRS)
IF (ENET_FOUND)
IF(WIN32)
SET(WINDOWS_ENET_DEPENDENCIES "ws2_32;winmm")
SET(ENet_LIBRARIES ${ENet_LIBRARY} ${WINDOWS_ENET_DEPENDENCIES})
ELSE(WIN32)
SET(ENet_LIBRARIES ${ENet_LIBRARY})
ENDIF(WIN32)
ENDIF (ENET_FOUND)
MARK_AS_ADVANCED(ENet_LIBRARY ENet_LIBRARIES ENet_INCLUDE_DIRS)