Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/cmake/FindENet.cmake @ 2582

Last change on this file since 2582 was 2582, checked in by rgrieder, 15 years ago
  • Using dependency directory directly in root dir of a branch as primary folder (./libs resp. ./dependencies) Second priority is ../libs for MinGW and ../lib_dist/vc8/dependencies for msvc.
  • Moved compiler and linker flags to ConfigPlatforms.cmake
  • Solved additional libraries for ENet under MinGW directly in FindEnet.cmake
  • Property svn:eol-style set to native
File size: 1.3 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#
8# $ENETDIR is an environment variable used for finding enet.
9#
10#  Borrowed from The Mana World
11#  http://themanaworld.org/
12#
13# Several changes and additions by Fabian 'x3n' Landau
14# Lots of simplifications by Adrian Friedli
15#                 > www.orxonox.net <
16
17FIND_PATH(ENET_INCLUDE_DIR enet/enet.h
18    PATHS
19    $ENV{ENETDIR}
20    /usr/local
21    /usr
22    PATH_SUFFIXES include
23)
24FIND_LIBRARY(ENET_LIBRARY_OPTIMIZED
25    NAMES enet
26    PATHS
27    $ENV{ENETDIR}
28    /usr/local
29    /usr
30    PATH_SUFFIXES lib
31)
32FIND_LIBRARY(ENET_LIBRARY_DEBUG
33    NAMES enet_${LIBRARY_DEBUG_POSTFIX}
34    PATHS
35    $ENV{ENETDIR}
36    /usr/local
37    /usr
38    PATH_SUFFIXES lib
39)
40
41# handle the QUIETLY and REQUIRED arguments and set ENET_FOUND to TRUE if
42# all listed variables are TRUE
43FIND_PACKAGE_HANDLE_STANDARD_ARGS(ENET DEFAULT_MSG
44    ENET_LIBRARY_OPTIMIZED
45    ENET_INCLUDE_DIR
46)
47
48# Set optimized and debug libraries
49IF(MINGW)
50  # ENet is linked statically, hence we need to add some windows dependencies
51  HandleLibraryTypes(ENET ws2_32 winmm)
52ELSE(MINGW)
53  HandleLibraryTypes(ENET)
54ENDIF(MINGW)
55
56MARK_AS_ADVANCED(
57    ENET_LIBRARY
58    ENET_LIBRARY_OPTIMIZED
59    ENET_LIBRARY_DEBUG
60    ENET_INCLUDE_DIR
61)
Note: See TracBrowser for help on using the repository browser.