1 | # - Locate OpenAL |
---|
2 | # This module defines |
---|
3 | # OPENAL_LIBRARY |
---|
4 | # OPENAL_FOUND, if false, do not try to link to OpenAL |
---|
5 | # OPENAL_INCLUDE_DIR, where to find the headers |
---|
6 | # |
---|
7 | # $OPENALDIR is an environment variable that would |
---|
8 | # correspond to the ./configure --prefix=$OPENALDIR |
---|
9 | # used in building OpenAL. |
---|
10 | # |
---|
11 | |
---|
12 | # Created by Eric Wing. This was influenced by the FindSDL.cmake module. |
---|
13 | # On OSX, this will prefer the Framework version (if found) over others. |
---|
14 | # People will have to manually change the cache values of |
---|
15 | # OPENAL_LIBRARY to override this selection. |
---|
16 | # Tiger will include OpenAL as part of the System. |
---|
17 | # But for now, we have to look around. |
---|
18 | # Other (Unix) systems should be able to utilize the non-framework paths. |
---|
19 | FIND_PATH(OPENAL_INCLUDE_DIR AL/al.h |
---|
20 | $ENV{OPENALDIR}/include |
---|
21 | ~/Library/Frameworks/OpenAL.framework/Headers |
---|
22 | /Library/Frameworks/OpenAL.framework/Headers |
---|
23 | /System/Library/Frameworks/OpenAL.framework/Headers # Tiger |
---|
24 | /usr/pack/openal-0.0.8-cl/include # Tardis specific hack |
---|
25 | /usr/local/include/ |
---|
26 | /usr/local/include/OpenAL |
---|
27 | /usr/local/include |
---|
28 | /usr/include/ |
---|
29 | /usr/include/OpenAL |
---|
30 | /usr/include |
---|
31 | /sw/include # Fink |
---|
32 | /sw/include/OpenAL |
---|
33 | /sw/include |
---|
34 | /opt/local/include # DarwinPorts |
---|
35 | /opt/local/include/OpenAL |
---|
36 | /opt/local/include |
---|
37 | /opt/csw/include # Blastwave |
---|
38 | /opt/csw/include/OpenAL |
---|
39 | /opt/csw/include |
---|
40 | /opt/include |
---|
41 | /opt/include/OpenAL |
---|
42 | /opt/include |
---|
43 | ../libs/openal-0.0.8/common/include |
---|
44 | ) |
---|
45 | # I'm not sure if I should do a special casing for Apple. It is |
---|
46 | # unlikely that other Unix systems will find the framework path. |
---|
47 | # But if they do ([Next|Open|GNU]Step?), |
---|
48 | # do they want the -framework option also? |
---|
49 | IF(${OPENAL_INCLUDE_DIR} MATCHES ".framework") |
---|
50 | STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" OPENAL_FRAMEWORK_PATH_TMP ${OPENAL_INCLUDE_DIR}) |
---|
51 | IF("${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks" |
---|
52 | OR "${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks" |
---|
53 | ) |
---|
54 | # String is in default search path, don't need to use -F |
---|
55 | SET (OPENAL_LIBRARY "-framework OpenAL" CACHE STRING "OpenAL framework for OSX") |
---|
56 | ELSE("${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks" |
---|
57 | OR "${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks" |
---|
58 | ) |
---|
59 | # String is not /Library/Frameworks, need to use -F |
---|
60 | SET(OPENAL_LIBRARY "-F${OPENAL_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX") |
---|
61 | ENDIF("${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks" |
---|
62 | OR "${OPENAL_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks" |
---|
63 | ) |
---|
64 | # Clear the temp variable so nobody can see it |
---|
65 | SET(OPENAL_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "") |
---|
66 | |
---|
67 | ELSE(${OPENAL_INCLUDE_DIR} MATCHES ".framework") |
---|
68 | FIND_LIBRARY(OPENAL_LIBRARY |
---|
69 | NAMES openal al OpenAL32 |
---|
70 | PATHS |
---|
71 | $ENV{OPENALDIR}/lib |
---|
72 | $ENV{OPENALDIR}/libs |
---|
73 | /usr/pack/openal-0.0.8-cl/i686-debian-linux3.1/lib |
---|
74 | /usr/local/lib |
---|
75 | /usr/lib |
---|
76 | /sw/lib |
---|
77 | /opt/local/lib |
---|
78 | /opt/csw/lib |
---|
79 | /opt/lib |
---|
80 | ../libs/openal-0.0.8/src/.libs |
---|
81 | ) |
---|
82 | ENDIF(${OPENAL_INCLUDE_DIR} MATCHES ".framework") |
---|
83 | |
---|
84 | SET(OPENAL_FOUND "NO") |
---|
85 | IF(OPENAL_LIBRARY) |
---|
86 | SET(OPENAL_FOUND "YES") |
---|
87 | MESSAGE(STATUS "OpenAL was found.") |
---|
88 | ENDIF(OPENAL_LIBRARY) |
---|
89 | |
---|
90 | |
---|