Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 8:59:48 PM (16 years ago)
Author:
rgrieder
Message:

Merged revisions 1875-2278 of the buildsystem branch to buildsystem2.

Location:
code/branches/buildsystem2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2

  • code/branches/buildsystem2/cmake/FindENet.cmake

    r1872 r2509  
    33#
    44#  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
     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.
    89#
    910#  Borrowed from The Mana World
     
    1112#
    1213# Several changes and additions by Fabian 'x3n' Landau
     14# Lots of simplifications by Adrian Friedli
    1315#                 > www.orxonox.net <
    1416
    15 IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
    16    SET(ENet_FIND_QUIETLY TRUE)
    17 ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
    18 
    1917FIND_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
     18    PATHS
     19    $ENV{ENETDIR}
     20    /usr/local
     21    /usr
     22    PATH_SUFFIXES include
    2523    )
    2624
    2725FIND_LIBRARY(ENet_LIBRARY
    2826    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
     27    PATHS
     28    $ENV{ENETDIR}
     29    /usr/local
     30    /usr
     31    PATH_SUFFIXES lib
    3232    )
    3333
    34 SET(ENET_FOUND FALSE)
    35 IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
    36     SET(ENET_FOUND TRUE)
    37     SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR})
     34# handle the QUIETLY and REQUIRED arguments and set ENET_FOUND to TRUE if
     35# all listed variables are TRUE
     36INCLUDE(FindPackageHandleStandardArgs)
     37FIND_PACKAGE_HANDLE_STANDARD_ARGS(ENet DEFAULT_MSG ENet_LIBRARY ENet_INCLUDE_DIR)
    3838
     39IF (ENET_FOUND)
    3940    IF(WIN32)
    4041        SET(WINDOWS_ENET_DEPENDENCIES "ws2_32;winmm")
    41         SET(ENet_LIBRARY ${ENet_LIBRARY} ${WINDOWS_ENET_DEPENDENCIES})
     42        SET(ENet_LIBRARIES ${ENet_LIBRARY} ${WINDOWS_ENET_DEPENDENCIES})
     43    ELSE(WIN32)
     44        SET(ENet_LIBRARIES ${ENet_LIBRARY})
    4245    ENDIF(WIN32)
    43 
    44     SET(ENET_LIBRARIES ${ENet_LIBRARY})
    45 ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
    46 
    47 IF (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)
    56 ELSE (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)
    6346ENDIF (ENET_FOUND)
    6447
    65 MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY)
     48MARK_AS_ADVANCED(ENet_LIBRARY ENet_INCLUDE_DIR)
Note: See TracChangeset for help on using the changeset viewer.