allow any CompoundPart to gain focus, if it canGainFocus()
[openc2e.git] / cmake / FindALUT.cmake
blob67e2de737b0648e222e9e7144e5eb1c037407ea6
1 # - Locate ALUT
2 # This module defines
3 #  ALUT_LIBRARY
4 #  ALUT_FOUND, if false, do not try to link to OpenAL 
5 #  ALUT_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 # 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
18   /usr/local/include/AL
19   /usr/local/include/OpenAL
20   /usr/local/include
21   /usr/include/AL
22   /usr/include/OpenAL
23   /usr/include
24   /sw/include/AL # Fink
25   /sw/include/OpenAL 
26   /sw/include
27   /opt/local/include/AL # DarwinPorts
28   /opt/local/include/OpenAL
29   /opt/local/include
30   /opt/csw/include/AL # Blastwave
31   /opt/csw/include/OpenAL
32   /opt/csw/include
33   /opt/include/AL
34   /opt/include/OpenAL
35   /opt/include
36   )
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"
45       )
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"
50       )
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"
55     )
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 
61     NAMES alut
62     PATHS
63     $ENV{OPENALDIR}/lib
64     $ENV{OPENALDIR}/libs
65     /usr/local/lib
66     /usr/lib
67     /sw/lib
68     /opt/local/lib
69     /opt/csw/lib
70     /opt/lib
71     )
72 ENDIF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
74 SET(ALUT_FOUND "NO")
75 IF(ALUT_LIBRARY)
76   SET(ALUT_FOUND "YES")
77 ENDIF(ALUT_LIBRARY)