Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/core2/cmake/FindALUT.cmake @ 1224

Last change on this file since 1224 was 790, checked in by nicolasc, 17 years ago

merged FICN back into trunk
awaiting release.

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