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 | # |
---|
12 | # Several changes and additions by Fabian 'x3n' Landau |
---|
13 | # > www.orxonox.net < |
---|
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 | ${DEPENDENCY_DIR}/enet-1.2/include |
---|
25 | ) |
---|
26 | |
---|
27 | FIND_LIBRARY(ENet_LIBRARY |
---|
28 | NAMES enet |
---|
29 | PATHS /usr/lib /usr/local/lib /usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/ |
---|
30 | ../libs/enet-1.1 |
---|
31 | ${DEPENDENCY_DIR}/enet-1.2/lib |
---|
32 | ) |
---|
33 | |
---|
34 | SET(ENET_FOUND FALSE) |
---|
35 | IF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
36 | SET(ENET_FOUND TRUE) |
---|
37 | SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR}) |
---|
38 | |
---|
39 | IF(WIN32) |
---|
40 | SET(WINDOWS_ENET_DEPENDENCIES "ws2_32;winmm") |
---|
41 | SET(ENet_LIBRARY ${ENet_LIBRARY} ${WINDOWS_ENET_DEPENDENCIES}) |
---|
42 | ENDIF(WIN32) |
---|
43 | |
---|
44 | SET(ENET_LIBRARIES ${ENet_LIBRARY}) |
---|
45 | ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
46 | |
---|
47 | IF (ENET_FOUND) |
---|
48 | IF (NOT ENet_FIND_QUIETLY) |
---|
49 | MESSAGE(STATUS "ENet was found.") |
---|
50 | IF (VERBOSE_FIND) |
---|
51 | MESSAGE (STATUS " include path: ${ENet_INCLUDE_DIR}") |
---|
52 | MESSAGE (STATUS " library path: ${ENet_LIBRARY}") |
---|
53 | MESSAGE (STATUS " libraries: enet") |
---|
54 | ENDIF (VERBOSE_FIND) |
---|
55 | ENDIF (NOT ENet_FIND_QUIETLY) |
---|
56 | ELSE (ENET_FOUND) |
---|
57 | IF (NOT ENet_INCLUDE_DIR) |
---|
58 | MESSAGE(SEND_ERROR "ENet include path was not found.") |
---|
59 | ENDIF (NOT ENet_INCLUDE_DIR) |
---|
60 | IF (NOT ENet_LIBRARY) |
---|
61 | MESSAGE(SEND_ERROR "ENet library was not found.") |
---|
62 | ENDIF (NOT ENet_LIBRARY) |
---|
63 | ENDIF (ENET_FOUND) |
---|
64 | |
---|
65 | MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY) |
---|