Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network/cmake/FindENet.cmake @ 2051

Last change on this file since 2051 was 1872, checked in by rgrieder, 16 years ago
  • Modified cmake files to support library finding when using Visual Studio precompiled dependencies
  • Removed vorbisenc executable from library dependency
  • Property svn:eol-style set to native
File size: 1.9 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    ${DEPENDENCY_DIR}/enet-1.2/include
25    )
26
27FIND_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
34SET(ENET_FOUND FALSE)
35IF (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})
45ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
46
47IF (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)
56ELSE (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)
63ENDIF (ENET_FOUND)
64
65MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY)
Note: See TracBrowser for help on using the repository browser.