Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/cmake/FindALUT.cmake @ 430

Last change on this file since 430 was 409, checked in by nicolape, 17 years ago

Simplified cmake audio lib messages

File size: 3.0 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.
18FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
19  $ENV{ALUTDIR}/include
20  ~/Library/Frameworks/OpenAL.framework/Headers
21  /Library/Frameworks/OpenAL.framework/Headers
22  /System/Library/Frameworks/OpenAL.framework/Headers # Tiger
23  /usr/pack/openal-0.0.8-cl/include # Tardis specific hack
24  /usr/local/include/
25  /usr/local/include/OpenAL
26  /usr/local/include
27  /usr/include/
28  /usr/include/OpenAL
29  /usr/include
30  /sw/include/ # Fink
31  /sw/include/OpenAL
32  /sw/include
33  /opt/local/include/AL # DarwinPorts
34  /opt/local/include/OpenAL
35  /opt/local/include
36  /opt/csw/include/ # Blastwave
37  /opt/csw/include/OpenAL
38  /opt/csw/include
39  /opt/include/
40  /opt/include/OpenAL
41  /opt/include
42  )
43# I'm not sure if I should do a special casing for Apple. It is
44# unlikely that other Unix systems will find the framework path.
45# But if they do ([Next|Open|GNU]Step?),
46# do they want the -framework option also?
47IF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
48  STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR})
49  IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
50      OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
51      )
52    # String is in default search path, don't need to use -F
53    SET (ALUT_LIBRARY "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
54  ELSE("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
55      OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
56      )
57    # String is not /Library/Frameworks, need to use -F
58    SET(ALUT_LIBRARY "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
59  ENDIF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
60    OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
61    )
62  # Clear the temp variable so nobody can see it
63  SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
64
65ELSE(${ALUT_INCLUDE_DIR} MATCHES ".framework")
66  FIND_LIBRARY(ALUT_LIBRARY
67    NAMES alut
68    PATHS
69    $ENV{ALUTDIR}/lib
70    $ENV{ALUTDIR}/libs
71                /usr/pack/openal-0.0.8-cl/i686-debian-linux3.1/lib
72    /usr/local/lib
73    /usr/lib
74    /sw/lib
75    /opt/local/lib
76    /opt/csw/lib
77    /opt/lib
78    )
79ENDIF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
80
81SET(ALUT_FOUND "NO")
82IF(ALUT_LIBRARY)
83  SET(ALUT_FOUND "YES")
84        MESSAGE(STATUS "FreeAlut was found")
85ENDIF(ALUT_LIBRARY)
86
87
Note: See TracBrowser for help on using the repository browser.