Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/tutorialHS08/cmake/FindENet.cmake @ 10215

Last change on this file since 10215 was 1776, checked in by landauf, 16 years ago

Many changes in almost all FindXYZ.cmake files. They now throw errors if something wasn't found.

  • Property svn:eol-style set to native
File size: 1.8 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# Several changes and additions by Fabian 'x3n' Landau
13#                 > www.orxonox.net <
14
15IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
16   SET(ENet_FIND_QUIETLY TRUE)
17ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
18
19FIND_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
26FIND_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
32SET(ENET_FOUND FALSE)
33IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
34    SET(ENET_FOUND TRUE)
35    SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR})
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
42    SET(ENET_LIBRARIES ${ENet_LIBRARY})
43ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
44
45IF (ENET_FOUND)
46    IF (NOT ENet_FIND_QUIETLY)
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)
53    ENDIF (NOT ENet_FIND_QUIETLY)
54ELSE (ENET_FOUND)
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)
61ENDIF (ENET_FOUND)
62
63MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY)
Note: See TracBrowser for help on using the repository browser.