Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2616 for code/branches


Ignore:
Timestamp:
Jan 29, 2009, 10:55:29 PM (16 years ago)
Author:
rgrieder
Message:
  • Split FindOggVorbis.cmake in two. Having them in one file doesn't make sense, we can group it somewhere else.
  • Updated all find scripts
  • Removed all standard paths (like /usr /usr/local, etc.) because they're already searched by CMake anyway
  • Several workarounds for certain libraries when using the find script in the CMake module path.
Location:
code/branches/buildsystem2/cmake
Files:
6 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/cmake/FindALUT.cmake

    r2614 r2616  
    2424INCLUDE(HandleLibraryTypes)
    2525
    26 SET(ALUT_PATHS
    27   $ENV{ALUTDIR}
    28   /usr/local
    29   /usr
    30   /sw        # Fink
    31   /opt/local # DarwinPorts
    32   /opt/csw   # Blastwave
    33   /opt
    34 )
    35 
    3626FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
    3727  PATHS
    38   ${ALUT_PATHS}
     28  $ENV{ALUTDIR}
    3929  ~/Library/Frameworks/OpenAL.framework
    4030  /Library/Frameworks/OpenAL.framework
     
    6959  FIND_LIBRARY(ALUT_LIBRARY_OPTIMIZED
    7060    NAMES alut
    71     PATHS ${ALUT_PATHS}
     61    PATHS $ENV{ALUTDIR}
    7262    PATH_SUFFIXES lib libs
    7363  )
    7464  FIND_LIBRARY(ALUT_LIBRARY_DEBUG
    75     NAMES alut${LIBRARY_DEBUG_POSTFIX}
    76     PATHS ${ALUT_PATHS}
     65    NAMES alutd alut_d
     66    PATHS $ENV{ALUTDIR}
    7767    PATH_SUFFIXES lib libs
    7868  )
    7969ENDIF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
    8070
    81 # handle the QUIETLY and REQUIRED arguments and set ALUT_FOUND to TRUE if
    82 # all listed variables are TRUE
     71# Handle the REQUIRED argument and set ALUT_FOUND
    8372FIND_PACKAGE_HANDLE_STANDARD_ARGS(ALUT DEFAULT_MSG
     73    ALUT_INCLUDE_DIR
    8474    ALUT_LIBRARY_OPTIMIZED
    85     ALUT_INCLUDE_DIR
    8675)
    8776
    88 # Set optimized and debug libraries
     77# Collect optimized and debug libraries
    8978HANDLE_LIBRARY_TYPES(ALUT)
    9079
    9180MARK_AS_ADVANCED(
    92     ALUT_LIBRARY
     81    ALUT_INCLUDE_DIR
    9382    ALUT_LIBRARY_OPTIMIZED
    9483    ALUT_LIBRARY_DEBUG
    95     ALUT_INCLUDE_DIR
    9684)
  • code/branches/buildsystem2/cmake/FindCEGUI.cmake

    r2614 r2616  
    1919#                 > www.orxonox.net <
    2020
    21 INCLUDE(FindPackageHandleStandardArgs)
     21INCLUDE(DetermineVersion)
     22INCLUDE(FindPackageHandleAdvancedArgs)
    2223INCLUDE(HandleLibraryTypes)
    2324
    2425FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
    25     PATHS
    26     $ENV{CEGUIDIR}
    27     /usr/local
    28     /usr
    29     PATH_SUFFIXES include include/CEGUI
     26  PATHS $ENV{CEGUIDIR}
     27  PATH_SUFFIXES include include/CEGUI
    3028)
    3129FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED
    32     NAMES CEGUIBase
    33     PATHS
    34     $ENV{CEGUIDIR}
    35     /usr/local
    36     /usr
    37     PATH_SUFFIXES lib bin
     30  NAMES CEGUIBase
     31  PATHS $ENV{CEGUIDIR}
     32  PATH_SUFFIXES lib bin
    3833)
    3934FIND_LIBRARY(CEGUI_LIBRARY_DEBUG
    40     NAMES CEGUIBase${LIBRARY_DEBUG_POSTFIX}
    41     PATHS
    42     $ENV{CEGUIDIR}
    43     /usr/local
    44     /usr
    45     PATH_SUFFIXES lib bin
     35  NAMES CEGUIBased CEGUIBase_d
     36  PATHS $ENV{CEGUIDIR}
     37  PATH_SUFFIXES lib bin
    4638)
    4739
    48 # Look in CEGUIVersion.h for the version number
    49 INCLUDE(DetermineVersion)
     40# Inspect CEGUIVersion.h for the version number
    5041DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
    51 # STRLESS can be dangerous since it only compares strings.
    52 # Unfortunately VERSION_LESS is only provided since CMake v2.6.2
    53 IF(${CEGUI_VERSION} STRLESS "0.5.0")
    54    MESSAGE(FATAL_ERROR "Minimum CEGUI version required is 0.5.0")
    55 ENDIF(${CEGUI_VERSION} STRLESS "0.5.0")
    5642
    57 
    58 #    IF (NOT CEGUI_SCRIPT_LIBDIR)
    59 #        # Search Lua script module
    60 #        SET(CEGUI_SCRIPT_LIBRARIES "CEGUILuaScriptModule")
    61 #        FIND_LIBRARY(CEGUI_SCRIPT_LIBDIR NAMES ${CEGUI_SCRIPT_LIBRARIES} PATHS
    62 #            ../libs/cegui-0.6.1/bin
    63 #        )
    64 #    IF (NOT CEGUI_SCRIPT_LIBDIR)
    65 #            SET(CEGUI_SCRIPT_LIBRARIES "CEGUILua")
    66 #            FIND_LIBRARY(CEGUI_SCRIPT_LIBDIR NAMES ${CEGUI_SCRIPT_LIBRARIES} PATHS
    67 #                ../libs/cegui-0.6.1/bin
    68 #            )
    69 #            IF (NOT CEGUI_SCRIPT_LIBDIR)
    70 #                SET(CEGUI_SCRIPT_LIBRARIES)
    71 #            ENDIF (NOT CEGUI_SCRIPT_LIBDIR)
    72 #        ENDIF (NOT CEGUI_SCRIPT_LIBDIR)
    73 #    ENDIF (NOT CEGUI_SCRIPT_LIBDIR)
    74 
    75 
    76 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUI DEFAULT_MSG
    77     CEGUI_LIBRARY_OPTIMIZED
    78     CEGUI_INCLUDE_DIR
    79     #CEGUI_SCRIPT_LIBRARIES
     43# Handle the REQUIRED argument and set CEGUI_FOUND
     44# Also checks the version requirements if given
     45FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}"
     46  CEGUI_INCLUDE_DIR
     47  CEGUI_LIBRARY_OPTIMIZED
    8048)
    8149
    82 # Set optimized and debug libraries
     50# Collect optimized and debug libraries
    8351HANDLE_LIBRARY_TYPES(CEGUI)
    8452
    8553MARK_AS_ADVANCED(
    86     CEGUI_LIBRARY
    87     CEGUI_LIBRARY_OPTIMIZED
    88     CEGUI_LIBRARY_DEBUG
    89     CEGUI_INCLUDE_DIR
    90     #CEGUI_SCRIPT_LIBRARIES
     54  CEGUI_INCLUDE_DIR
     55  CEGUI_LIBRARY_OPTIMIZED
     56  CEGUI_LIBRARY_DEBUG
    9157)
     58
     59LIST(FIND CEGUILUA_INTERNAL_SUPPORT "${CEGUI_VERSION}" _find_result)
     60IF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
     61  # Also try to find the CEGUILua libraries.
     62  # There would already be libraries in src/ for versions 0.5 and 0.6
     63  FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED
     64    NAMES CEGUILua
     65    PATHS $ENV{CEGUIDIR}
     66    PATH_SUFFIXES lib bin
     67  )
     68  FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG
     69    NAMES CEGUILuad CEGUILua_d
     70    PATHS $ENV{CEGUIDIR}
     71    PATH_SUFFIXES lib bin
     72  )
     73
     74  SET(CEGUILua_FIND_REQUIRED ${CEGUI_FIND_REQUIRED})
     75  # Handle the REQUIRED argument and set CEGUILUA_FOUND
     76  FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUILua DEFAULT_MSG
     77    CEGUILUA_LIBRARY_OPTIMIZED
     78  )
     79
     80  # Collect optimized and debug libraries
     81  HANDLE_LIBRARY_TYPES(CEGUILUA)
     82
     83  MARK_AS_ADVANCED(
     84    CEGUILUA_LIBRARY_OPTIMIZED
     85    CEGUILUA_LIBRARY_DEBUG
     86  )
     87
     88ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
     89  SET(CEGUILUA_USE_INTERNAL_LIBRARY TRUE)
     90ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
     91
  • code/branches/buildsystem2/cmake/FindDirectX.cmake

    r2594 r2616  
     1# Find script for DirectX on Windows
     2# Once loaded this will define
     3#   DirectX_FOUND        - system has DirectX
     4#   DirectX_INCLUDE_DIR  - include directory for DirectX
     5#   DirectX_LIBRARY      - library for DirectX
     6#
     7# Several changes and additions by Fabian 'x3n' Landau
     8#                 > www.orxonox.net <
     9
    110INCLUDE(FindPackageHandleStandardArgs)
    211INCLUDE(HandleLibraryTypes)
    312
    4 IF(WIN32)
    5   # Find script for DirectX on Windows
    6   # Once loaded this will define
    7   #   DirectX_FOUND        - system has DirectX
    8   #   DirectX_INCLUDE_DIR  - include directory for DirectX
    9   #   DirectX_LIBRARY      - library for DirectX
    10   #
    11   # Several changes and additions by Fabian 'x3n' Landau
    12   #                 > www.orxonox.net <
     13FIND_PATH(DIRECTX_INCLUDE_DIR dinput.h
     14  PATHS
     15  $ENV{DXSDK_DIR}
     16  PATH_SUFFIXES include
     17)
     18FIND_LIBRARY(DIRECTX_LIBRARY_input dinput8
     19  PATHS
     20  $ENV{DXSDK_DIR}
     21  PATH_SUFFIXES lib Lib lib/x86 Lib/x86
     22)
     23FIND_LIBRARY(DIRECTX_LIBRARY_guid dxguid
     24  PATHS
     25  $ENV{DXSDK_DIR}
     26  PATH_SUFFIXES lib Lib lib/x86 Lib/x86
     27)
    1328
    14   FIND_PATH(DirectX_INCLUDE_DIR dinput.h
    15     PATHS
    16     $ENV{DXSDK_DIR}
    17     PATH_SUFFIXES include
    18   )
     29# Handle the REQUIRED argument and set DIRECTX_FOUND
     30FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectX DEFAULT_MSG
     31  DIRECTX_INCLUDE_DIR
     32  DIRECTX_LIBRARY_input
     33  DIRECTX_LIBRARY_guid
     34)
    1935
    20   FIND_LIBRARY(DirectX_LIBRARY_1 dinput8
    21     PATHS
    22     $ENV{DXSDK_DIR}
    23     PATH_SUFFIXES lib Lib lib/x86 Lib/x86
    24   )
    25   FIND_LIBRARY(DirectX_LIBRARY_2 dxguid
    26     PATHS
    27     $ENV{DXSDK_DIR}
    28     PATH_SUFFIXES lib Lib lib/x86 Lib/x86
    29   )
    30 
    31   FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectX DEFAULT_MSG
    32     DirectX_LIBRARY_1
    33     DirectX_LIBRARY_2
    34     DirectX_INCLUDE_DIR
    35   )
    36 
    37   IF(DIRECTX_FOUND)
    38     SET(DirectX_LIBRARIES ${DirectX_LIBRARY_1} ${DirectX_LIBRARY_2} CACHE STRING "DirectX library files" FORCE)
    39   ENDIF(DIRECTX_FOUND)
    40 ENDIF(WIN32)
     36SET(DIRECTX_LIBRARIES ${DIRECTX_LIBRARY_input} ${DIRECTX_LIBRARY_guid})
    4137
    4238MARK_AS_ADVANCED(
    43   DirectX_INCLUDE_DIR
    44   DirectX_LIBRARY_1
    45   DirectX_LIBRARY_2
    46   DirectX_LIBRARIES
     39  DIRECTX_INCLUDE_DIR
     40  DIRECTX_LIBRARY_input
     41  DIRECTX_LIBRARY_guid
    4742)
  • code/branches/buildsystem2/cmake/FindENet.cmake

    r2614 r2616  
    1515#                 > www.orxonox.net <
    1616
    17 INCLUDE(FindPackageHandleStandardArgs)
     17INCLUDE(FindPackageHandleAdvancedArgs)
    1818INCLUDE(HandleLibraryTypes)
    1919
    2020FIND_PATH(ENET_INCLUDE_DIR enet/enet.h
    21     PATHS
    22     $ENV{ENETDIR}
    23     /usr/local
    24     /usr
    25     PATH_SUFFIXES include
     21  PATHS $ENV{ENETDIR}
     22  PATH_SUFFIXES include
    2623)
    2724FIND_LIBRARY(ENET_LIBRARY_OPTIMIZED
    28     NAMES enet
    29     PATHS
    30     $ENV{ENETDIR}
    31     /usr/local
    32     /usr
    33     PATH_SUFFIXES lib
     25  NAMES enet
     26  PATHS $ENV{ENETDIR}
     27  PATH_SUFFIXES lib
    3428)
    3529FIND_LIBRARY(ENET_LIBRARY_DEBUG
    36     NAMES enet${LIBRARY_DEBUG_POSTFIX}
    37     PATHS
    38     $ENV{ENETDIR}
    39     /usr/local
    40     /usr
    41     PATH_SUFFIXES lib
     30  NAMES enetd enet_d
     31  PATHS $ENV{ENETDIR}
     32  PATH_SUFFIXES lib
    4233)
    4334
    44 # handle the QUIETLY and REQUIRED arguments and set ENET_FOUND to TRUE if
    45 # all listed variables are TRUE
    46 FIND_PACKAGE_HANDLE_STANDARD_ARGS(ENET DEFAULT_MSG
    47     ENET_LIBRARY_OPTIMIZED
    48     ENET_INCLUDE_DIR
     35# Try to determine the version. Note that enet only stores the major
     36# version in the header file. So we check for existing functions.
     37# Hence the this script only distinguishes between 1.0, 1.1 and 1.2
     38FILE(STRINGS ${ENET_INCLUDE_DIR}/enet/enet.h _enet_header REGEX "ENET_")
     39IF(_enet_header MATCHES "ENET_VERSION[ \t]*=[ \t]*1")
     40  IF(_enet_header MATCHES "enet_socket_set_option")
     41    SET(ENET_VERSION 1.2)
     42  ELSEIF(_enet_header MATCHES "enet_peer_disconnect_later")
     43    SET(ENET_VERSION 1.1)
     44  ELSE(_enet_header MATCHES "enet_socket_set_option")
     45    SET(ENET_VERSION 1.0)
     46  ENDIF(_enet_header MATCHES "enet_socket_set_option")
     47ELSE(_enet_header MATCHES "ENET_VERSION[ \t]*=[ \t]*1")
     48  SET(ENET_VERSION 0) # Script doesn't support versions below 1.0
     49ENDIF(_enet_header MATCHES "ENET_VERSION[ \t]*=[ \t]*1")
     50
     51# Handle the REQUIRED argument and set ENET_FOUND
     52# Also check the the version requirements
     53FIND_PACKAGE_HANDLE_ADVANCED_ARGS(ENet DEFAULT_MSG ${ENET_VERSION}
     54  ENET_INCLUDE_DIR
     55  ENET_LIBRARY_OPTIMIZED
    4956)
    5057
    51 # Set optimized and debug libraries
    52 IF(MINGW)
     58# Collect optimized and debug libraries
     59IF(NOT LINK_ENET_DYNAMIC AND WIN32)
    5360  # ENet is linked statically, hence we need to add some windows dependencies
    5461  HANDLE_LIBRARY_TYPES(ENET ws2_32 winmm)
    55 ELSE(MINGW)
     62ELSE(NOT LINK_ENET_DYNAMIC AND WIN32)
    5663  HANDLE_LIBRARY_TYPES(ENET)
    57 ENDIF(MINGW)
     64ENDIF(NOT LINK_ENET_DYNAMIC AND WIN32)
    5865
    5966MARK_AS_ADVANCED(
    60     ENET_LIBRARY
    61     ENET_LIBRARY_OPTIMIZED
    62     ENET_LIBRARY_DEBUG
    63     ENET_INCLUDE_DIR
     67  ENET_INCLUDE_DIR
     68  ENET_LIBRARY_OPTIMIZED
     69  ENET_LIBRARY_DEBUG
    6470)
  • code/branches/buildsystem2/cmake/FindOGRE.cmake

    r2614 r2616  
    1313# Several changes and additions by Fabian 'x3n' Landau
    1414# Lots of simplifications by Adrian Friedli
    15 # Plugin checking by Reto Grieder
    1615#                 > www.orxonox.net <
    1716
    18 INCLUDE(FindPackageHandleStandardArgs)
     17INCLUDE(DetermineVersion)
     18INCLUDE(FindPackageHandleAdvancedArgs)
    1919INCLUDE(HandleLibraryTypes)
    2020
    2121FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
    22     PATHS $ENV{OGRE_HOME} /usr/local /usr
    23     PATH_SUFFIXES include include/OGRE
     22  PATHS $ENV{OGRE_HOME}
     23  PATH_SUFFIXES include include/OGRE
    2424)
    2525FIND_LIBRARY(OGRE_LIBRARY_OPTIMIZED
    26     NAMES OgreMain
    27     PATHS $ENV{OGRE_HOME} /usr/local /usr
    28     PATH_SUFFIXES lib bin/Release bin/release Release release
     26  NAMES OgreMain
     27  PATHS $ENV{OGRE_HOME}
     28  PATH_SUFFIXES lib bin/Release bin/release Release release
    2929)
    3030FIND_LIBRARY(OGRE_LIBRARY_DEBUG
    31     NAMES OgreMain${LIBRARY_DEBUG_POSTFIX}
    32     PATHS $ENV{OGRE_HOME} /usr/local /usr
    33     PATH_SUFFIXES lib bin/Debug bin/debug Debug debug
     31  NAMES OgreMaind OgreMain_d
     32  PATHS $ENV{OGRE_HOME}
     33  PATH_SUFFIXES lib bin/Debug bin/debug Debug debug
    3434)
    3535
    36 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGRE DEFAULT_MSG
    37     OGRE_LIBRARY_OPTIMIZED
    38     OGRE_INCLUDE_DIR
     36# Inspect OgrePrerquisites.h for the version number
     37DETERMINE_VERSION(OGRE ${OGRE_INCLUDE_DIR}/OgrePrerequisites.h)
     38
     39# Handle the REQUIRED argument and set OGRE_FOUND
     40# Also check the version requirements
     41FIND_PACKAGE_HANDLE_ADVANCED_ARGS(OGRE DEFAULT_MSG ${OGRE_VERSION}
     42  OGRE_INCLUDE_DIR
     43  OGRE_LIBRARY_OPTIMIZED
    3944)
    4045
    41 # Set optimized and debug libraries
     46# Collect optimized and debug libraries
    4247HANDLE_LIBRARY_TYPES(OGRE)
    4348
    4449MARK_AS_ADVANCED(
    45     OGRE_LIBRARY
    46     OGRE_LIBRARY_OPTIMIZED
    47     OGRE_LIBRARY_DEBUG
    48     OGRE_INCLUDE_DIR
     50  OGRE_INCLUDE_DIR
     51  OGRE_LIBRARY_OPTIMIZED
     52  OGRE_LIBRARY_DEBUG
    4953)
  • code/branches/buildsystem2/cmake/FindOgg.cmake

    r2614 r2616  
    55#  OGG_INCLUDE_DIR
    66#  OGG_LIBRARY
    7 #  VORBIS_FOUND - system has vorbis
    8 #  VORBIS_INCLUDE_DIR
    9 #  VORBIS_LIBRARY
    10 #  VORBISENC_LIBRARY
    11 #  VORBISFILE_LIBRARY
    127#
    13 # $OGGDIR and $VORBISDIR are environment variables used
    14 # for finding ogg/vorbis.
     8# $OGGDIR is an environment variable used
     9# for finding ogg.
    1510#
    1611# Several changes and additions by Fabian 'x3n' Landau
     
    2116INCLUDE(HandleLibraryTypes)
    2217
    23 SET(OGG_SEARCH_PATHS
    24   $ENV{OGGDIR}
    25   $ENV{VORBISDIR}
    26   /usr/local
    27   /usr
    28   /sw
    29   /opt/local
    30   /opt/csw
    31   /opt
    32 )
    33 
    3418FIND_PATH(OGG_INCLUDE_DIR ogg/ogg.h
    35   PATHS ${OGG_SEARCH_PATHS}
     19  PATHS $ENV{OGGDIR}
    3620  PATH_SUFFIXES include
    3721)
    3822FIND_PATH(VORBIS_INCLUDE_DIR vorbis/codec.h
    39   PATHS ${OGG_SEARCH_PATHS}
     23  PATHS $ENV{OGGDIR}
    4024  PATH_SUFFIXES include
    4125)
    42 FIND_LIBRARY(OGG_LIBRARY_OPTIMIZED NAMES ogg
    43   PATHS ${OGG_SEARCH_PATHS}
     26FIND_LIBRARY(OGG_LIBRARY_OPTIMIZED
     27  NAMES ogg
     28  PATHS $ENV{OGGDIR}
    4429  PATH_SUFFIXES lib
    4530)
    46 FIND_LIBRARY(OGG_LIBRARY_DEBUG NAMES ogg${LIBRARY_DEBUG_POSTFIX}
    47   PATHS ${OGG_SEARCH_PATHS}
    48   PATH_SUFFIXES lib
    49 )
    50 FIND_LIBRARY(VORBIS_LIBRARY_OPTIMIZED NAMES vorbis
    51   PATHS ${OGG_SEARCH_PATHS}
    52   PATH_SUFFIXES lib
    53 )
    54 FIND_LIBRARY(VORBIS_LIBRARY_DEBUG NAMES vorbis${LIBRARY_DEBUG_POSTFIX}
    55   PATHS ${OGG_SEARCH_PATHS}
    56   PATH_SUFFIXES lib
    57 )
    58 FIND_LIBRARY(VORBISFILE_LIBRARY_OPTIMIZED NAMES vorbisfile
    59   PATHS ${OGG_SEARCH_PATHS}
    60   PATH_SUFFIXES lib
    61 )
    62 FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG NAMES vorbisfile${LIBRARY_DEBUG_POSTFIX}
    63   PATHS ${OGG_SEARCH_PATHS}
     31FIND_LIBRARY(OGG_LIBRARY_DEBUG
     32  NAMES oggd ogg_d
     33  PATHS $ENV{VORBISDIR}
    6434  PATH_SUFFIXES lib
    6535)
    6636
    67 # handle the QUIETLY and REQUIRED arguments and set *_FOUND to TRUE if
    68 # all listed variables are TRUE
    69 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGG DEFAULT_MSG
     37# Handle the REQUIRED argument and set OGG_FOUND
     38FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ogg DEFAULT_MSG
     39  OGG_INCLUDE_DIR
    7040  OGG_LIBRARY_OPTIMIZED
    71   OGG_INCLUDE_DIR
    72 )
    73 SET(VORBIS_FIND_REQUIRED ON)
    74 FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBIS DEFAULT_MSG
    75   VORBIS_LIBRARY_OPTIMIZED
    76   VORBIS_INCLUDE_DIR
    77 )
    78 SET(VORBISFILE_FIND_REQUIRED ON)
    79 FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBISFILE DEFAULT_MSG
    80   VORBISFILE_LIBRARY_OPTIMIZED
    81   VORBIS_INCLUDE_DIR
    8241)
    8342
    84 # Set optimized and debug libraries
     43# Collect optimized and debug libraries
    8544HANDLE_LIBRARY_TYPES(OGG)
    86 HANDLE_LIBRARY_TYPES(VORBIS)
    87 HANDLE_LIBRARY_TYPES(VORBISFILE)
    8845
    8946MARK_AS_ADVANCED(
    90   OGG_LIBRARY
     47  OGG_INCLUDE_DIR
    9148  OGG_LIBRARY_OPTIMIZED
    9249  OGG_LIBRARY_DEBUG
    93   OGG_INCLUDE_DIR
    94   VORBIS_LIBRARY
    95   VORBIS_LIBRARY_OPTIMIZED
    96   VORBIS_LIBRARY_DEBUG
    97   VORBISFILE_LIBRARY
    98   VORBISFILE_LIBRARY_OPTIMIZED
    99   VORBISFILE_LIBRARY_DEBUG
    100   VORBIS_INCLUDE_DIR
    10150)
  • code/branches/buildsystem2/cmake/FindVorbis.cmake

    r2614 r2616  
    22# Once done this will define
    33#
    4 #  OGG_FOUND - system has ogg
    5 #  OGG_INCLUDE_DIR
    6 #  OGG_LIBRARY
    74#  VORBIS_FOUND - system has vorbis
    85#  VORBIS_INCLUDE_DIR
     
    118#  VORBISFILE_LIBRARY
    129#
    13 # $OGGDIR and $VORBISDIR are environment variables used
    14 # for finding ogg/vorbis.
     10# $VORBISDIR is an environment variable used
     11# for finding vorbis.
    1512#
    1613# Several changes and additions by Fabian 'x3n' Landau
     
    2118INCLUDE(HandleLibraryTypes)
    2219
    23 SET(OGG_SEARCH_PATHS
    24   $ENV{OGGDIR}
    25   $ENV{VORBISDIR}
    26   /usr/local
    27   /usr
    28   /sw
    29   /opt/local
    30   /opt/csw
    31   /opt
    32 )
    33 
    34 FIND_PATH(OGG_INCLUDE_DIR ogg/ogg.h
    35   PATHS ${OGG_SEARCH_PATHS}
     20FIND_PATH(VORBIS_INCLUDE_DIR vorbis/codec.h
     21  PATHS $ENV{VORBISDIR}
    3622  PATH_SUFFIXES include
    3723)
    38 FIND_PATH(VORBIS_INCLUDE_DIR vorbis/codec.h
    39   PATHS ${OGG_SEARCH_PATHS}
    40   PATH_SUFFIXES include
    41 )
    42 FIND_LIBRARY(OGG_LIBRARY_OPTIMIZED NAMES ogg
    43   PATHS ${OGG_SEARCH_PATHS}
     24FIND_LIBRARY(VORBIS_LIBRARY_OPTIMIZED
     25  NAMES vorbis
     26  PATHS $ENV{VORBISDIR}
    4427  PATH_SUFFIXES lib
    4528)
    46 FIND_LIBRARY(OGG_LIBRARY_DEBUG NAMES ogg${LIBRARY_DEBUG_POSTFIX}
    47   PATHS ${OGG_SEARCH_PATHS}
     29FIND_LIBRARY(VORBIS_LIBRARY_DEBUG
     30  NAMES vorbisd vorbis_d
     31  PATHS $ENV{VORBISDIR}
    4832  PATH_SUFFIXES lib
    4933)
    50 FIND_LIBRARY(VORBIS_LIBRARY_OPTIMIZED NAMES vorbis
    51   PATHS ${OGG_SEARCH_PATHS}
     34FIND_LIBRARY(VORBISFILE_LIBRARY_OPTIMIZED
     35  NAMES vorbisfile
     36  PATHS $ENV{VORBISDIR}
    5237  PATH_SUFFIXES lib
    5338)
    54 FIND_LIBRARY(VORBIS_LIBRARY_DEBUG NAMES vorbis${LIBRARY_DEBUG_POSTFIX}
    55   PATHS ${OGG_SEARCH_PATHS}
    56   PATH_SUFFIXES lib
    57 )
    58 FIND_LIBRARY(VORBISFILE_LIBRARY_OPTIMIZED NAMES vorbisfile
    59   PATHS ${OGG_SEARCH_PATHS}
    60   PATH_SUFFIXES lib
    61 )
    62 FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG NAMES vorbisfile${LIBRARY_DEBUG_POSTFIX}
    63   PATHS ${OGG_SEARCH_PATHS}
     39FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG
     40  NAMES vorbisfiled vorbisfile_d
     41  PATHS $ENV{VORBISDIR}
    6442  PATH_SUFFIXES lib
    6543)
    6644
    67 # handle the QUIETLY and REQUIRED arguments and set *_FOUND to TRUE if
    68 # all listed variables are TRUE
    69 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGG DEFAULT_MSG
    70   OGG_LIBRARY_OPTIMIZED
    71   OGG_INCLUDE_DIR
    72 )
    73 SET(VORBIS_FIND_REQUIRED ON)
    74 FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBIS DEFAULT_MSG
     45# Handle the REQUIRED argument and set VORBIS_FOUND
     46FIND_PACKAGE_HANDLE_STANDARD_ARGS(Vorbis DEFAULT_MSG
    7547  VORBIS_LIBRARY_OPTIMIZED
    76   VORBIS_INCLUDE_DIR
    77 )
    78 SET(VORBISFILE_FIND_REQUIRED ON)
    79 FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBISFILE DEFAULT_MSG
    8048  VORBISFILE_LIBRARY_OPTIMIZED
    8149  VORBIS_INCLUDE_DIR
    8250)
    8351
    84 # Set optimized and debug libraries
    85 HANDLE_LIBRARY_TYPES(OGG)
     52# Collect optimized and debug libraries
    8653HANDLE_LIBRARY_TYPES(VORBIS)
    8754HANDLE_LIBRARY_TYPES(VORBISFILE)
     55SET(VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
    8856
    8957MARK_AS_ADVANCED(
    90   OGG_LIBRARY
    91   OGG_LIBRARY_OPTIMIZED
    92   OGG_LIBRARY_DEBUG
    93   OGG_INCLUDE_DIR
    94   VORBIS_LIBRARY
     58  VORBIS_INCLUDE_DIR
    9559  VORBIS_LIBRARY_OPTIMIZED
    9660  VORBIS_LIBRARY_DEBUG
    97   VORBISFILE_LIBRARY
    9861  VORBISFILE_LIBRARY_OPTIMIZED
    9962  VORBISFILE_LIBRARY_DEBUG
    100   VORBIS_INCLUDE_DIR
    10163)
  • code/branches/buildsystem2/cmake/LibraryConfig.cmake

    r2615 r2616  
    33INCLUDE(LibraryConfigTardis)
    44
    5 # Performs the search and sets the variables
     5############### Library finding #################
     6# Performs the search and sets the variables    #
    67
    7 # Expand the next statement if newer boost versions than 1.36.1 are released
    8 SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0 CACHE STRING "")
    9 FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem)
    10 # With MSVC, automatic linking is performed for boost. So wee need to tell
    11 # the linker where to find them. Also note that when running FindBoost for the
    12 # first time, it will set ${Boost_LIBRARIES} to "" but afterwards to the libs.
    13 IF (MSVC)
    14   LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
    15 ENDIF (MSVC)
    16 FIND_PACKAGE(OGRE REQUIRED)
    17 FIND_PACKAGE(CEGUI REQUIRED)
    18 FIND_PACKAGE(ENet REQUIRED)
    19 FIND_PACKAGE(OpenAL REQUIRED)
    20 FIND_PACKAGE(ALUT REQUIRED)
    21 FIND_PACKAGE(OggVorbis REQUIRED)
    22 FIND_PACKAGE(ZLIB REQUIRED)
    23 FIND_PACKAGE(DirectX REQUIRED)
     8FIND_PACKAGE(OGRE  1.4 EXACT REQUIRED)
     9FIND_PACKAGE(ENet  1.1       REQUIRED)
     10FIND_PACKAGE(Ogg             REQUIRED)
     11FIND_PACKAGE(Vorbis          REQUIRED)
     12FIND_PACKAGE(ALUT            REQUIRED)
     13FIND_PACKAGE(ZLIB            REQUIRED)
     14IF(WIN32)
     15  FIND_PACKAGE(DirectX       REQUIRED)
     16ENDIF(WIN32)
     17
     18##### CEGUI #####
     19# We make use of the CEGUI script module called CEGUILua.
     20# However there is a small issue with that: We use Tolua, a C++ binding
     21# generator ourselves. And we also have to use our bindings in the same
     22# lua state is CEGUILua's. Unfortunately this implies that both lua runtime
     23# version are equal or else you get segmentation faults.
     24# In order to match the Lua versions we decided to ship CEGUILua in our
     25# repository, mainly because there is no way to determine which version of
     26# Lua CEGUILua was linked against (you'd have to specify yourself) and secondly
     27# because we can then choose the Lua version. Future plans might involve only
     28# accepting Lua 5.1.
     29
     30# Insert all internally supported CEGUILua versions here
     31SET(CEGUILUA_INTERNAL_SUPPORT 0.5.0 0.6.0 0.6.1 0.6.2)
     32OPTION(CEGUILUA_USE_EXTERNAL_LIBRARY "Force the use of external CEGUILua library" OFF)
     33FIND_PACKAGE(CEGUI 0.5 REQUIRED)
    2434
    2535##### Lua #####
     
    3646FIND_PACKAGE(Lua ${LUA_VERSION_REQUEST} EXACT REQUIRED)
    3747
    38 # QUIET: Don't require the whole tcl rat tail
    39 FIND_PACKAGE(TCL QUIET)
    40 IF(NOT TCL_FOUND)
    41   MESSAGE(FATAL_ERROR "Tcl was not found.")
    42 ENDIF(NOT TCL_FOUND)
    43 
    44 # Hide variables created by CMake FindXX scripts
     48##### OpenAL #####
     49FIND_PACKAGE(OpenAL REQUIRED)
     50# ALUT's headers include openal headers, but like <AL/al.h>, not <al.h>
     51# Unfortunately this is not the case on all systems, so FindOpenAL.cmake
     52# specifies the directory/AL, which now causes problems with ALUT.
     53IF(DEFINED OPENAL_FOUND_FIRST_TIME)
     54  SET(OPENAL_FOUND_FIRST_TIME FALSE CACHE INTERNAL "")
     55ELSE(DEFINED OPENAL_FOUND_FIRST_TIME)
     56  SET(OPENAL_FOUND_FIRST_TIME TRUE CACHE INTERNAL "")
     57  STRING(REGEX REPLACE "^(.*)/AL$" "\\1" _openal_dir_2 ${OPENAL_INCLUDE_DIR})
     58  IF(_openal_dir_2)
     59    SET(OPENAL_INCLUDE_DIR ${OPENAL_INCLUDE_DIR} ${_openal_dir_2} CACHE STRING "" FORCE)
     60  ENDIF(_openal_dir_2)
     61ENDIF(DEFINED OPENAL_FOUND_FIRST_TIME)
     62# Hide variables created by the script
    4563MARK_AS_ADVANCED(
    46   LUA_LIBRARY_lua
    47   LUA_LIBRARY_lualib
    4864  OPENAL_INCLUDE_DIR
    4965  OPENAL_LIBRARY
    5066)
     67
     68##### TCL #####
     69# We only require TCL, so avoid confusing user about other TCL stuff by
     70# applying a little workaround
     71SET(Tclsh_FIND_QUIETLY TRUE)
     72FIND_PACKAGE(TCL 8.4 REQUIRED QUIET)
     73# Display messages separately
     74SET(TCL_FIND_QUIETLY FALSE)
     75FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCL DEFAULT_MSG TCL_LIBRARY TCL_INCLUDE_PATH)
     76# Workaround a CMake bug that doesn't set the variables to the cache
     77# Occurs at least on CMake 2.6.2 and 2.6.0 under Windows
     78SET(TCL_LIBRARY ${TCL_LIBRARY} CACHE FILEPATH "")
     79SET(TCL_INCLUDE_PATH ${TCL_INCLUDE_PATH} CACHE PATH "")
     80
     81##### Boost #####
     82# Expand the next statement if newer boost versions than 1.36.1 are released
     83SET(Boost_ADDITIONAL_VERSIONS 1.37 1.37.0)
     84FIND_PACKAGE(Boost 1.34 REQUIRED thread filesystem)
     85# With MSVC, automatic linking is performed for boost. So wee need to tell
     86# the linker where to find them. Also note that when running FindBoost for the
     87# first time, it will set ${Boost_LIBRARIES} to "" but afterwards to the libs.
     88IF (MSVC)
     89  # Little bit hacky, but Boost_LIBRARY_DIRS doesn't get set right when having
     90  # debug and optimized libraries.
     91  GET_FILENAME_COMPONENT(BOOST_LINK_DIR "${Boost_THREAD_LIBRARY_RELEASE}" PATH)
     92  LINK_DIRECTORIES(${BOOST_LINK_DIR})
     93ENDIF (MSVC)
Note: See TracChangeset for help on using the changeset viewer.