Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2054


Ignore:
Timestamp:
Oct 29, 2008, 3:45:22 PM (16 years ago)
Author:
adrfried
Message:

FindALUT and FindENet cleaned up

Location:
code/branches/buildsystem
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem/cmake/CheckTardis.cmake

    r1999 r2054  
    4242  SET(ENV{ALUTDIR} "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
    4343  SET(ENV{OPENALDIR} "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
     44  SET(ENV{ENETDIR} "/usr/pack/enet-2007-sd;/usr/pack/enet-2007-sd/i686-debian-linux3.1")
    4445  #SET(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")
    4546ENDIF (IS_TARDIS)
  • code/branches/buildsystem/cmake/FindALUT.cmake

    r1991 r2054  
    2020# Some simplifications by Adrian Friedli
    2121#                 > www.orxonox.net <
    22 
    23 IF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
    24   SET (ALUT_FIND_QUIETLY TRUE)
    25 ENDIF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
    2622
    2723FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
     
    7773ENDIF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
    7874
    79 SET (ALUT_FOUND "NO")
    80 IF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
    81   SET (ALUT_FOUND "YES")
    82   IF (NOT ALUT_FIND_QUIETLY)
    83     MESSAGE (STATUS "FreeAlut was found.")
    84     IF (VERBOSE_FIND)
    85       MESSAGE (STATUS "  include path: ${ALUT_INCLUDE_DIR}")
    86       MESSAGE (STATUS "  library path: ${ALUT_LIBRARY}")
    87       MESSAGE (STATUS "  libraries:    alut")
    88     ENDIF (VERBOSE_FIND)
    89   ENDIF (NOT ALUT_FIND_QUIETLY)
    90 ELSE (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
    91   IF (NOT ALUT_INCLUDE_DIR)
    92     MESSAGE (SEND_ERROR "FreeAlut include path was not found.")
    93   ENDIF (NOT ALUT_INCLUDE_DIR)
    94   IF (NOT ALUT_LIBRARY)
    95     MESSAGE (SEND_ERROR "FreeAlut library was not found.")
    96   ENDIF (NOT ALUT_LIBRARY)
    97 ENDIF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
     75# handle the QUIETLY and REQUIRED arguments and set ALUT_FOUND to TRUE if
     76# all listed variables are TRUE
     77INCLUDE(FindPackageHandleStandardArgs)
     78FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG ALUT_LIBRARY ALUT_INCLUDE_DIR)
     79
     80MARK_AS_ADVANCED(ALUT_LIBRARY ALUT_INCLUDE_DIR)
  • code/branches/buildsystem/cmake/FindENet.cmake

    r1999 r2054  
    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 # Tardis specific hack
    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)
  • code/branches/buildsystem/src/CMakeLists.txt

    r1980 r2054  
    1717
    1818# Set the search paths for the linking
     19# TODO: remove this after the CMake Modules have been fixed and use absolut paths
    1920LINK_DIRECTORIES(
    2021  ${OGRE_LIB_DIR}
    2122  ${CEGUI_LIB_DIR}
    22 #  ${CEGUI_SCRIPT_LIB_DIR}
    23 #  ${CEGUI_OGRE_LIB_DIR}
    24   ${ENet_LIBRARY}
    25   ${Boost_LIBRARY_DIRS}
    26   ${Zlib_LIBRARY_DIR}
    27   ${TCL_LIBRARY}
    2823)
    2924
  • code/branches/buildsystem/src/network/CMakeLists.txt

    r1977 r2054  
    2727TARGET_LINK_LIBRARIES( network
    2828  ${ZLIB_LIBRARY}
    29   ${ENet_LIBRARY}
     29  ${ENet_LIBRARIES}
    3030  ${Boost_THREAD_LIBRARY}
    3131  core
     
    4343    ${OGRE_LIBRARIES}
    4444    network
    45     ${ENet_LIBRARY}
     45    ${ENet_LIBRARIES}
    4646    ${ZLIB_LIBRARY}
    47     ${WINDOWS_ENET_DEPENDENCIES}
    4847  )
    4948  ##### end test for gamestate stuff #####
Note: See TracChangeset for help on using the changeset viewer.