Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/lod/cmake/FindALUT.cmake @ 12373

Last change on this file since 12373 was 1872, checked in by rgrieder, 16 years ago
  • Modified cmake files to support library finding when using Visual Studio precompiled dependencies
  • Removed vorbisenc executable from library dependency
  • Property svn:eol-style set to native
File size: 4.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.
18#
19# Several changes and additions by Fabian 'x3n' Landau
20#                 > www.orxonox.net <
21
22IF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
23  SET (ALUT_FIND_QUIETLY TRUE)
24ENDIF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
25
26FIND_PATH(ALUT_INCLUDE_DIR AL/alut.h
27  $ENV{ALUTDIR}/include
28  ~/Library/Frameworks/OpenAL.framework/Headers
29  /Library/Frameworks/OpenAL.framework/Headers
30  /System/Library/Frameworks/OpenAL.framework/Headers # Tiger
31  /usr/pack/openal-0.0.8-cl/include # Tardis specific hack
32  /usr/local/include/
33  /usr/local/include/OpenAL
34  /usr/local/include
35  /usr/include/
36  /usr/include/OpenAL
37  /usr/include
38  /sw/include/ # Fink
39  /sw/include/OpenAL
40  /sw/include
41  /opt/local/include/AL # DarwinPorts
42  /opt/local/include/OpenAL
43  /opt/local/include
44  /opt/csw/include/ # Blastwave
45  /opt/csw/include/OpenAL
46  /opt/csw/include
47  /opt/include/
48  /opt/include/OpenAL
49  /opt/include
50  ../libs/freealut-1.1.0/include
51  ${DEPENDENCY_DIR}/freealut-1.1.0/include
52  )
53
54# I'm not sure if I should do a special casing for Apple. It is
55# unlikely that other Unix systems will find the framework path.
56# But if they do ([Next|Open|GNU]Step?),
57# do they want the -framework option also?
58IF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
59  STRING(REGEX REPLACE "(.*)/.*\\.framework/.*" "\\1" ALUT_FRAMEWORK_PATH_TMP ${ALUT_INCLUDE_DIR})
60  IF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
61      OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
62      )
63    # String is in default search path, don't need to use -F
64    SET (ALUT_LIBRARY "-framework OpenAL" CACHE STRING "OpenAL framework for OSX")
65  ELSE("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
66      OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
67      )
68    # String is not /Library/Frameworks, need to use -F
69    SET(ALUT_LIBRARY "-F${ALUT_FRAMEWORK_PATH_TMP} -framework OpenAL" CACHE STRING "OpenAL framework for OSX")
70  ENDIF("${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/Library/Frameworks"
71    OR "${ALUT_FRAMEWORK_PATH_TMP}" STREQUAL "/System/Library/Frameworks"
72    )
73  # Clear the temp variable so nobody can see it
74  SET(ALUT_FRAMEWORK_PATH_TMP "" CACHE INTERNAL "")
75
76ELSE(${ALUT_INCLUDE_DIR} MATCHES ".framework")
77  FIND_LIBRARY(ALUT_LIBRARY
78    NAMES alut
79    PATHS
80    $ENV{ALUTDIR}/lib
81    $ENV{ALUTDIR}/libs
82    /usr/pack/openal-0.0.8-cl/i686-debian-linux3.1/lib
83    /usr/local/lib
84    /usr/lib
85    /sw/lib
86    /opt/local/lib
87    /opt/csw/lib
88    /opt/lib
89    ../libs/freealut-1.1.0/src/.libs
90    ../libs/freealut-1.1.0/lib
91    ${DEPENDENCY_DIR}/freealut-1.1.0/lib
92    )
93ENDIF(${ALUT_INCLUDE_DIR} MATCHES ".framework")
94
95SET (ALUT_FOUND "NO")
96IF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
97  SET (ALUT_FOUND "YES")
98  IF (NOT ALUT_FIND_QUIETLY)
99    MESSAGE (STATUS "FreeAlut was found.")
100    IF (VERBOSE_FIND)
101      MESSAGE (STATUS "  include path: ${ALUT_INCLUDE_DIR}")
102      MESSAGE (STATUS "  library path: ${ALUT_LIBRARY}")
103      MESSAGE (STATUS "  libraries:    alut")
104    ENDIF (VERBOSE_FIND)
105  ENDIF (NOT ALUT_FIND_QUIETLY)
106ELSE (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
107  IF (NOT ALUT_INCLUDE_DIR)
108    MESSAGE (SEND_ERROR "FreeAlut include path was not found.")
109  ENDIF (NOT ALUT_INCLUDE_DIR)
110  IF (NOT ALUT_LIBRARY)
111    MESSAGE (SEND_ERROR "FreeAlut library was not found.")
112  ENDIF (NOT ALUT_LIBRARY)
113ENDIF (ALUT_LIBRARY AND ALUT_INCLUDE_DIR)
114
115
Note: See TracBrowser for help on using the repository browser.