4 # ALUT_FOUND, if false, do not try to link to OpenAL
5 # ALUT_INCLUDE_DIR, where to find the headers
7 # $OPENALDIR is an environment variable that would
8 # correspond to the ./configure --prefix=$OPENALDIR
9 # used in building OpenAL.
11 # Created by Bryan Donlan, based on the FindOpenAL.cmake module by Eric Wang.
13 FIND_PATH(ALUT_INCLUDE_DIR alut.h
14 $ENV{OPENALDIR}/include
15 ~/Library/Frameworks/OpenAL.framework/Headers
16 /Library/Frameworks/OpenAL.framework/Headers
17 /System/Library/Frameworks/OpenAL.framework/Headers # Tiger
19 /usr/local/include/OpenAL
27 /opt/local/include/AL # DarwinPorts
28 /opt/local/include/OpenAL
30 /opt/csw/include/AL # Blastwave
31 /opt/csw/include/OpenAL
37 # I'm not sure if I should do a special casing for Apple. It is
38 # unlikely that other Unix systems will find the framework path.
39 # But if they do ([Next|Open|GNU]Step?),
40 # do they want the -framework option also?
41 IF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
42 STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR})
43 IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
44 OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
46 # String is in default search path, don't need to use -F
47 SET (ALUT_LIBRARY "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
48 ELSE("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
49 OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
51 # String is not /Library/Frameworks, need to use -F
52 SET(ALUT_LIBRARY "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
53 ENDIF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
54 OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
56 # Clear the temp variable so nobody can see it
57 SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
59 ELSE(${ALUT_INCLUDE_DIR} MATCHES ".framework")
60 FIND_LIBRARY(ALUT_LIBRARY
72 ENDIF(${ALUT_INCLUDE_DIR} MATCHES ".framework")