Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2061


Ignore:
Timestamp:
Oct 29, 2008, 4:44:58 PM (16 years ago)
Author:
adrfried
Message:

FindOggVorbis cleaned up

Location:
code/branches/buildsystem/cmake
Files:
2 edited

Legend:

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

    r2054 r2061  
    4343  SET(ENV{OPENALDIR} "/usr/pack/openal-0.0.8-cl;/usr/pack/openal-0.0.8-cl/i686-debian-linux3.1")
    4444  SET(ENV{ENETDIR} "/usr/pack/enet-2007-sd;/usr/pack/enet-2007-sd/i686-debian-linux3.1")
     45  SET(ENV{OGGVORBISDIR} "/usr/pack/oggvorbis-1.0-ds;/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0")
    4546  #SET(TCL_INCLUDE_PATH "/usr/pack/tcltk-8.4.9.linux-mo/include")
    4647ENDIF (IS_TARDIS)
  • code/branches/buildsystem/cmake/FindOggVorbis.cmake

    r1873 r2061  
     1# - Try to find ogg/vorbis
     2# Once done this will define
     3#
     4#  OGG_FOUND - system has ogg
     5#  OGG_INCLUDE_DIR
     6#  OGG_LIBRARY
     7#  VORBIS_FOUND - system has vorbis
     8#  VORBIS_INCLUDE_DIR
     9#  VORBIS_LIBRARY
     10#  VORBISENC_LIBRARY
     11#  VORBISFILE_LIBRARY
     12#
     13# $OGGVORBISDIR is an environment variable used for finding ogg/vorbis.
     14#
    115# Several changes and additions by Fabian 'x3n' Landau
     16# Most of all rewritten by Adrian Friedli
    217#                 > www.orxonox.net <
    318
    4 IF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
    5   SET(OGG_FIND_QUIETLY TRUE)
    6 ENDIF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
    7 
    8 IF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISENC_LIBRARY AND VORBISFILE_LIBRARY)
    9   SET(VORBIS_FIND_QUIETLY TRUE)
    10 ENDIF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISENC_LIBRARY AND VORBISFILE_LIBRARY)
    11 
    12 
    13 #SET(OGGVORBIS_LIBRARY_DIR "/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/lib")
    14 #SET(OGGVORBIS_LIBRARY "-L ${OGGVORBIS_LIBRARY_DIR} -lvorbisenc -lvorbisfile -logg -lvorbis ")
    15 #SET(OGGVORBIS_INCLUDE_DIR "/usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include")
    16 
    17 #
    18 # Includes
    19 #
     19SET(OGG_SEARCH_PATHS
     20  $ENV{OGGVORBISDIR}
     21  /usr/local
     22  /usr
     23  /sw
     24  /opt/local
     25  /opt/csw
     26  /opt
     27)
    2028
    2129FIND_PATH(OGG_INCLUDE_DIR ogg/ogg.h
    22   /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include               # Tardis specific hack
    23   /usr/local/include
    24   /usr/include
    25   /sw/include
    26   /opt/local/include
    27   /opt/csw/include
    28   /opt/csw/include
    29   /opt/include
    30   ../libs/libogg-1.1.3/include
    31   ${DEPENDENCY_DIR}/libogg-1.1.3/include
    32   )
     30  PATHS ${OGG_SEARCH_PATHS}
     31  PATH_SUFFIXES include
     32)
    3333
    3434FIND_PATH(VORBIS_INCLUDE_DIR vorbis/codec.h
    35   /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.0/include               # Tardis specific hack
    36   /usr/local/include
    37   /usr/include
    38   /sw/include
    39   /opt/local/include
    40   /opt/csw/include
    41   /opt/csw/include
    42   /opt/include
    43   ../libs/libvorbis-1.2.0/include
    44   ${DEPENDENCY_DIR}/libvorbis-1.2.0/include
    45   )
     35  PATHS ${OGG_SEARCH_PATHS}
     36  PATH_SUFFIXES include
     37)
    4638
    47 #
    48 # Libs
    49 #
     39FIND_LIBRARY(OGG_LIBRARY NAMES ogg
     40  PATHS ${OGG_SEARCH_PATHS}
     41  PATH_SUFFIXES lib
     42)
    5043
    51 FIND_LIBRARY(OGG_LIBRARY
    52   NAMES ogg
    53   PATHS
    54   /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
    55   /usr/local/lib
    56   /usr/lib
    57   /sw/lib
    58   /opt/local/lib
    59   /opt/csw/lib
    60   /opt/lib
    61   ../libs/libogg-1.1.3/src/.libs
    62   ${DEPENDENCY_DIR}/libogg-1.1.3/lib
    63   )
     44FIND_LIBRARY(VORBIS_LIBRARY NAMES vorbis
     45  PATHS ${OGG_SEARCH_PATHS}
     46  PATH_SUFFIXES lib
     47)
    6448
    65 FIND_LIBRARY(VORBIS_LIBRARY
    66   NAMES vorbis
    67   PATHS
    68   /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
    69   /usr/local/lib
    70   /usr/lib
    71   /sw/lib
    72   /opt/local/lib
    73   /opt/csw/lib
    74   /opt/lib
    75   ../libs/libvorbis-1.2.0/lib/.libs
    76   ${DEPENDENCY_DIR}/libvorbis-1.2.0/lib
    77   )
     49#FIND_LIBRARY(VORBISENC_LIBRARY NAMES vorbisenc
     50#  PATHS ${OGG_SEARCH_PATHS}
     51#  PATH_SUFFIXES lib
     52#)
    7853
    79 #FIND_LIBRARY(VORBISENC_LIBRARY
    80 #  NAMES vorbisenc
    81 #  PATHS
    82 #  /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
    83 #  /usr/local/lib
    84 #  /usr/lib
    85 #  /sw/lib
    86 #  /opt/local/lib
    87 #  /opt/csw/lib
    88 #  /opt/lib
    89 #  ../libs/libvorbis-1.2.0/lib/.libs
    90 #  )
     54FIND_LIBRARY(VORBISFILE_LIBRARY NAMES vorbisfile
     55  PATHS ${OGG_SEARCH_PATHS}
     56  PATH_SUFFIXES lib
     57)
    9158
    92 FIND_LIBRARY(VORBISFILE_LIBRARY
    93   NAMES vorbisfile
    94   PATHS
    95   /usr/pack/oggvorbis-1.0-ds/i686-debian-linux3.1/lib
    96   /usr/local/lib
    97   /usr/lib
    98   /sw/lib
    99   /opt/local/lib
    100   /opt/csw/lib
    101   /opt/lib
    102   ../libs/libvorbis-1.2.0/lib/.libs
    103   ${DEPENDENCY_DIR}/libvorbis-1.2.0/lib
    104   )
     59# handle the QUIETLY and REQUIRED arguments and set *_FOUND to TRUE if
     60# all listed variables are TRUE
     61INCLUDE(FindPackageHandleStandardArgs)
     62FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGG DEFAULT_MSG OGG_LIBRARY OGG_INCLUDE_DIR)
     63FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBIS DEFAULT_MSG
     64  VORBIS_LIBRARY
     65  VORBISFILE_LIBRARY
     66  #VORBISENC_LIBRARY
     67  VORBIS_INCLUDE_DIR
     68)
    10569
    106 SET (OGG_FOUND "NO")
    107 
    108 IF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
    109   SET (OGG_FOUND "YES")
    110   IF (NOT OGG_FIND_QUIETLY)
    111     MESSAGE (STATUS "Ogg was found.")
    112     IF (VERBOSE_FIND)
    113       MESSAGE (STATUS "  include path: ${OGG_INCLUDE_DIR}")
    114       MESSAGE (STATUS "  library path: ${OGG_LIBRARY}")
    115       MESSAGE (STATUS "  libraries:    ogg")
    116     ENDIF (VERBOSE_FIND)
    117   ENDIF (NOT OGG_FIND_QUIETLY)
    118 ELSE (OGG_INCLUDE_DIR AND OGG_LIBRARY)
    119   IF (NOT OGG_INCLUDE_DIR)
    120     MESSAGE (SEND_ERROR "Ogg include path was not found.")
    121   ENDIF (NOT OGG_INCLUDE_DIR)
    122   IF (NOT OGG_LIBRARY)
    123     MESSAGE (SEND_ERROR "Ogg library was not found.")
    124   ENDIF (NOT OGG_LIBRARY)
    125 ENDIF (OGG_INCLUDE_DIR AND OGG_LIBRARY)
    126 
    127 
    128 SET (VORBIS_FOUND "NO")
    129 
    130 IF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)# AND VORBISENC_LIBRARY)
    131   SET (VORBIS_FOUND "YES")
    132   IF (NOT VORBIS_FIND_QUIETLY)
    133     MESSAGE (STATUS "Vorbis was found.")
    134     IF (VERBOSE_FIND)
    135       MESSAGE (STATUS "  include path: ${VORBIS_INCLUDE_DIR}")
    136       MESSAGE (STATUS "  library path: ${VORBIS_LIBRARY}")
    137       #MESSAGE (STATUS "  library path: ${VORBISENC_LIBRARY}")
    138       MESSAGE (STATUS "  library path: ${VORBISFILE_LIBRARY}")
    139       MESSAGE (STATUS "  libraries:    vorbis vorbisenc vorbisfile")
    140     ENDIF (VERBOSE_FIND)
    141   ENDIF (NOT VORBIS_FIND_QUIETLY)
    142 ELSE (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)# AND VORBISENC_LIBRARY)
    143   IF (NOT VORBIS_INCLUDE_DIR)
    144     MESSAGE (SEND_ERROR "Vorbis include path was not found.")
    145   ENDIF (NOT VORBIS_INCLUDE_DIR)
    146   IF (NOT VORBIS_LIBRARY)
    147     MESSAGE (SEND_ERROR "Vorbis library \"vorbis\" was not found.")
    148   ENDIF (NOT VORBIS_LIBRARY)
    149   #IF (NOT VORBISENC_LIBRARY)
    150   #  MESSAGE (SEND_ERROR "Vorbis library \"vorbisenc\" was not found.")
    151   #ENDIF (NOT VORBISENC_LIBRARY)
    152   IF (NOT VORBISFILE_LIBRARY)
    153     MESSAGE (SEND_ERROR "Vorbis library \"vorbisfile\" was not found.")
    154   ENDIF (NOT VORBISFILE_LIBRARY)
    155 ENDIF (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)# AND VORBISENC_LIBRARY)
    156 
     70MARK_AS_ADVANCED(
     71  OGG_LIBRARY
     72  OGG_INCLUDE_DIR
     73  VORBIS_LIBRARY
     74  VORBISFILE_LIBRARY
     75  VORBIS_INCLUDE_DIR
     76)
Note: See TracChangeset for help on using the changeset viewer.