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 | |
---|
13 | IF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
14 | SET(ENet_FIND_QUIETLY TRUE) |
---|
15 | ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
16 | |
---|
17 | FIND_PATH(ENet_INCLUDE_DIR enet/enet.h |
---|
18 | /usr/include |
---|
19 | /usr/local/include |
---|
20 | /usr/pack/enet-2007-sd/include |
---|
21 | ../libs/enet-1.1/include |
---|
22 | ) |
---|
23 | |
---|
24 | FIND_LIBRARY(ENet_LIBRARY |
---|
25 | NAMES enet |
---|
26 | PATHS /usr/lib /usr/local/lib /usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/ |
---|
27 | ../libs/enet-1.1 |
---|
28 | ) |
---|
29 | |
---|
30 | IF(WIN32) |
---|
31 | SET(WINDOWS_ENET_DEPENDENCIES "ws2_32;winmm") |
---|
32 | SET(ENet_LIBRARY ${ENet_LIBRARY} ${WINDOWS_ENET_DEPENDENCIES}) |
---|
33 | ENDIF(WIN32) |
---|
34 | |
---|
35 | IF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
36 | SET(ENET_FOUND TRUE) |
---|
37 | SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR}) |
---|
38 | SET(ENET_LIBRARIES ${ENet_LIBRARY}) |
---|
39 | ELSE (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
40 | SET(ENET_FOUND FALSE) |
---|
41 | ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
42 | |
---|
43 | IF (ENET_FOUND) |
---|
44 | IF (NOT ENet_FIND_QUIETLY) |
---|
45 | MESSAGE(STATUS "Found enet: ${ENet_LIBRARY}") |
---|
46 | ENDIF (NOT ENet_FIND_QUIETLY) |
---|
47 | ELSE (ENET_FOUND) |
---|
48 | IF (ENet_FIND_REQUIRED) |
---|
49 | MESSAGE(FATAL_ERROR "Could NOT find enet") |
---|
50 | ENDIF (ENet_FIND_REQUIRED) |
---|
51 | ENDIF (ENET_FOUND) |
---|
52 | |
---|
53 | MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY) |
---|