[1505] | 1 | # - Try to find enet |
---|
| 2 | # Once done this will define |
---|
| 3 | # |
---|
| 4 | # ENET_FOUND - system has enet |
---|
| 5 | # ENET_INCLUDE_DIR - the enet include directory |
---|
| 6 | # ENET_LIBRARIES - the libraries needed to use enet |
---|
| 7 | # ENET_DEFINITIONS - Compiler switches required for using enet |
---|
| 8 | # |
---|
| 9 | # Borrowed from The Mana World |
---|
| 10 | # http://themanaworld.org/ |
---|
| 11 | # |
---|
[1776] | 12 | # Several changes and additions by Fabian 'x3n' Landau |
---|
| 13 | # > www.orxonox.net < |
---|
[1505] | 14 | |
---|
| 15 | IF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
| 16 | SET(ENet_FIND_QUIETLY TRUE) |
---|
| 17 | ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
| 18 | |
---|
| 19 | FIND_PATH(ENet_INCLUDE_DIR enet/enet.h |
---|
| 20 | /usr/include |
---|
| 21 | /usr/local/include |
---|
| 22 | /usr/pack/enet-2007-sd/include |
---|
| 23 | ../libs/enet-1.1/include |
---|
| 24 | ) |
---|
| 25 | |
---|
| 26 | FIND_LIBRARY(ENet_LIBRARY |
---|
| 27 | NAMES enet |
---|
| 28 | PATHS /usr/lib /usr/local/lib /usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/ |
---|
| 29 | ../libs/enet-1.1 |
---|
| 30 | ) |
---|
| 31 | |
---|
[1776] | 32 | SET(ENET_FOUND FALSE) |
---|
[1505] | 33 | IF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
| 34 | SET(ENET_FOUND TRUE) |
---|
| 35 | SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR}) |
---|
[1776] | 36 | |
---|
| 37 | IF(WIN32) |
---|
| 38 | SET(WINDOWS_ENET_DEPENDENCIES "ws2_32;winmm") |
---|
| 39 | SET(ENet_LIBRARY ${ENet_LIBRARY} ${WINDOWS_ENET_DEPENDENCIES}) |
---|
| 40 | ENDIF(WIN32) |
---|
| 41 | |
---|
[1505] | 42 | SET(ENET_LIBRARIES ${ENet_LIBRARY}) |
---|
| 43 | ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
| 44 | |
---|
| 45 | IF (ENET_FOUND) |
---|
| 46 | IF (NOT ENet_FIND_QUIETLY) |
---|
[1776] | 47 | MESSAGE(STATUS "ENet was found.") |
---|
| 48 | IF (VERBOSE_FIND) |
---|
| 49 | MESSAGE (STATUS " include path: ${ENet_INCLUDE_DIR}") |
---|
| 50 | MESSAGE (STATUS " library path: ${ENet_LIBRARY}") |
---|
| 51 | MESSAGE (STATUS " libraries: enet") |
---|
| 52 | ENDIF (VERBOSE_FIND) |
---|
[1505] | 53 | ENDIF (NOT ENet_FIND_QUIETLY) |
---|
| 54 | ELSE (ENET_FOUND) |
---|
[1776] | 55 | IF (NOT ENet_INCLUDE_DIR) |
---|
| 56 | MESSAGE(SEND_ERROR "ENet include path was not found.") |
---|
| 57 | ENDIF (NOT ENet_INCLUDE_DIR) |
---|
| 58 | IF (NOT ENet_LIBRARY) |
---|
| 59 | MESSAGE(SEND_ERROR "ENet library was not found.") |
---|
| 60 | ENDIF (NOT ENet_LIBRARY) |
---|
[1505] | 61 | ENDIF (ENET_FOUND) |
---|
| 62 | |
---|
| 63 | MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY) |
---|