Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/tutorial/cmake/FindENet.cmake @ 1806

Last change on this file since 1806 was 859, checked in by landauf, 17 years ago

more or less a copy of the trunk

File size: 1.5 KB
Line 
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
13IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
14   SET(ENet_FIND_QUIETLY TRUE)
15ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
16
17FIND_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
24FIND_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
30IF(WIN32)
31  SET(WINDOWS_ENET_DEPENDENCIES "ws2_32;winmm")
32  SET(ENet_LIBRARY ${ENet_LIBRARY} ${WINDOWS_ENET_DEPENDENCIES})
33ENDIF(WIN32)
34
35IF (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})
39ELSE (ENet_INCLUDE_DIR AND ENet_LIBRARY)
40    SET(ENET_FOUND FALSE)
41ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
42
43IF (ENET_FOUND)
44    IF (NOT ENet_FIND_QUIETLY)
45        MESSAGE(STATUS "Found enet: ${ENet_LIBRARY}")
46    ENDIF (NOT ENet_FIND_QUIETLY)
47ELSE (ENET_FOUND)
48    IF (ENet_FIND_REQUIRED)
49        MESSAGE(FATAL_ERROR "Could NOT find enet")
50    ENDIF (ENet_FIND_REQUIRED)
51ENDIF (ENET_FOUND)
52
53MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY)
Note: See TracBrowser for help on using the repository browser.