Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/cmake/FindALUT.cmake @ 1864

Last change on this file since 1864 was 1776, checked in by landauf, 16 years ago

Many changes in almost all FindXYZ.cmake files. They now throw errors if something wasn't found.

  • Property svn:eol-style set to native
File size: 3.9 KB
Line 
1# - Locate FreeAlut
2# This module defines
3#  ALUT_LIBRARY
4#  ALUT_FOUND, if false, do not try to link to Alut
5#  ALUT_INCLUDE_DIR, where to find the headers
6#
7# $ALUTDIR is an environment variable that would
8# correspond to the ./configure --prefix=$ALUTDIR
9# used in building Alut.
10#
11# Created by Eric Wing. This was influenced by the FindSDL.cmake module.
12# On OSX, this will prefer the Framework version (if found) over others.
13# People will have to manually change the cache values of
14# ALUT_LIBRARY to override this selection.
15# Tiger will include OpenAL as part of the System.
16# But for now, we have to look around.
17# Other (Unix) systems should be able to utilize the non-framework paths.
18#
19# Several changes and additions by Fabian 'x3n' Landau
20#                 > www.orxonox.net <
21
22IF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
23  SET (ALUT_FIND_QUIETLY TRUE)
24ENDIF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
25
26FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
27  $ENV{ALUTDIR}/include
28  ~/Library/Frameworks/OpenAL.framework/Headers
29  /Library/Frameworks/OpenAL.framework/Headers
30  /System/Library/Frameworks/OpenAL.framework/Headers # Tiger
31  /usr/pack/openal-0.0.8-cl/include # Tardis specific hack
32  /usr/local/include/
33  /usr/local/include/OpenAL
34  /usr/local/include
35  /usr/include/
36  /usr/include/OpenAL
37  /usr/include
38  /sw/include/ # Fink
39  /sw/include/OpenAL
40  /sw/include
41  /opt/local/include/AL # DarwinPorts
42  /opt/local/include/OpenAL
43  /opt/local/include
44  /opt/csw/include/ # Blastwave
45  /opt/csw/include/OpenAL
46  /opt/csw/include
47  /opt/include/
48  /opt/include/OpenAL
49  /opt/include
50  ../libs/freealut-1.1.0/include
51  )
52
53# I'm not sure if I should do a special casing for Apple. It is
54# unlikely that other Unix systems will find the framework path.
55# But if they do ([Next|Open|GNU]Step?),
56# do they want the -framework option also?
57IF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
58  STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR})
59  IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
60      OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
61      )
62    # String is in default search path, don't need to use -F
63    SET (ALUT_LIBRARY "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
64  ELSE("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
65      OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
66      )
67    # String is not /Library/Frameworks, need to use -F
68    SET(ALUT_LIBRARY "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
69  ENDIF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
70    OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
71    )
72  # Clear the temp variable so nobody can see it
73  SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
74
75ELSE(${ALUT_INCLUDE_DIR} MATCHES ".framework")
76  FIND_LIBRARY(ALUT_LIBRARY
77    NAMES alut
78    PATHS
79    $ENV{ALUTDIR}/lib
80    $ENV{ALUTDIR}/libs
81    /usr/pack/openal-0.0.8-cl/i686-debian-linux3.1/lib
82    /usr/local/lib
83    /usr/lib
84    /sw/lib
85    /opt/local/lib
86    /opt/csw/lib
87    /opt/lib
88    ../libs/freealut-1.1.0/src/.libs
89    ../libs/freealut-1.1.0/lib
90    )
91ENDIF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
92
93SET (ALUT_FOUND "NO")
94IF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
95  SET (ALUT_FOUND "YES")
96  IF (NOT ALUT_FIND_QUIETLY)
97    MESSAGE (STATUS "FreeAlut was found.")
98    IF (VERBOSE_FIND)
99      MESSAGE (STATUS "  include path: ${ALUT_INCLUDE_DIR}")
100      MESSAGE (STATUS "  library path: ${ALUT_LIBRARY}")
101      MESSAGE (STATUS "  libraries:    alut")
102    ENDIF (VERBOSE_FIND)
103  ENDIF (NOT ALUT_FIND_QUIETLY)
104ELSE (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
105  IF (NOT ALUT_INCLUDE_DIR)
106    MESSAGE (SEND_ERROR "FreeAlut include path was not found.")
107  ENDIF (NOT ALUT_INCLUDE_DIR)
108  IF (NOT ALUT_LIBRARY)
109    MESSAGE (SEND_ERROR "FreeAlut library was not found.")
110  ENDIF (NOT ALUT_LIBRARY)
111ENDIF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
112
113
Note: See TracBrowser for help on using the repository browser.