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 | ) |
---|
22 | |
---|
23 | FIND_LIBRARY(ENet_LIBRARY |
---|
24 | NAMES enet |
---|
25 | PATHS /usr/lib /usr/local/lib /usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/ |
---|
26 | ) |
---|
27 | |
---|
28 | IF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
29 | SET(ENET_FOUND TRUE) |
---|
30 | SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR}) |
---|
31 | SET(ENET_LIBRARIES ${ENet_LIBRARY}) |
---|
32 | ELSE (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
33 | SET(ENET_FOUND FALSE) |
---|
34 | ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY) |
---|
35 | |
---|
36 | IF (ENET_FOUND) |
---|
37 | IF (NOT ENet_FIND_QUIETLY) |
---|
38 | MESSAGE(STATUS "Found enet: ${ENet_LIBRARY}") |
---|
39 | ENDIF (NOT ENet_FIND_QUIETLY) |
---|
40 | ELSE (ENET_FOUND) |
---|
41 | IF (ENet_FIND_REQUIRED) |
---|
42 | MESSAGE(FATAL_ERROR "Could NOT find enet") |
---|
43 | ENDIF (ENet_FIND_REQUIRED) |
---|
44 | ENDIF (ENET_FOUND) |
---|
45 | |
---|
46 | MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY) |
---|