7 # Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND, if
\r
8 # false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where to find
\r
11 # $OPENALDIR is an environment variable that would correspond to the
\r
12 # ./configure --prefix=$OPENALDIR used in building OpenAL.
\r
14 # Created by Eric Wing. This was influenced by the FindSDL.cmake
\r
17 #=============================================================================
\r
18 # Copyright 2005-2009 Kitware, Inc.
\r
20 # Distributed under the OSI-approved BSD License (the "License");
\r
21 # see accompanying file Copyright.txt for details.
\r
23 # This software is distributed WITHOUT ANY WARRANTY; without even the
\r
24 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\r
25 # See the License for more information.
\r
26 #=============================================================================
\r
27 # (To distribute this file outside of CMake, substitute the full
\r
28 # License text for the above reference.)
\r
30 # This makes the presumption that you are include al.h like
\r
33 # #include <AL/al.h>
\r
34 # The reason for this is that the latter is not entirely portable.
\r
35 # Windows/Creative Labs does not by default put their headers in AL/ and
\r
36 # OS X uses the convention <OpenAL/al.h>.
\r
38 # For Windows, Creative Labs seems to have added a registry key for their
\r
39 # OpenAL 1.1 installer. I have added that key to the list of search paths,
\r
40 # however, the key looks like it could be a little fragile depending on
\r
41 # if they decide to change the 1.00.0000 number for bug fix releases.
\r
42 # Also, they seem to have laid down groundwork for multiple library platforms
\r
43 # which puts the library in an extra subdirectory. Currently there is only
\r
44 # Win32 and I have hardcoded that here. This may need to be adjusted as
\r
45 # platforms are introduced.
\r
46 # The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
\r
47 # I do not know if the Nvidia OpenAL SDK has a registry key.
\r
49 # For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
\r
50 # To support the framework, I originally wrote special framework detection
\r
51 # code in this module which I have now removed with CMake's introduction
\r
52 # of native support for frameworks.
\r
53 # In addition, OpenAL is open source, and it is possible to compile on Panther.
\r
54 # Furthermore, due to bugs in the initial OpenAL release, and the
\r
55 # transition to OpenAL 1.1, it is common to need to override the built-in
\r
57 # Per my request, CMake should search for frameworks first in
\r
58 # the following order:
\r
59 # ~/Library/Frameworks/OpenAL.framework/Headers
\r
60 # /Library/Frameworks/OpenAL.framework/Headers
\r
61 # /System/Library/Frameworks/OpenAL.framework/Headers
\r
63 # On OS X, this will prefer the Framework version (if found) over others.
\r
64 # People will have to manually change the cache values of
\r
65 # OPENAL_LIBRARY to override this selection or set the CMake environment
\r
66 # CMAKE_INCLUDE_PATH to modify the search paths.
\r
68 find_path(OPENAL_INCLUDE_DIR al.h
\r
72 PATH_SUFFIXES include/AL include/OpenAL include
\r
74 ~/Library/Frameworks
\r
77 /opt/local # DarwinPorts
\r
78 /opt/csw # Blastwave
\r
80 [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
\r
83 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
84 set(_OpenAL_ARCH_DIR libs/Win64 lib/Win64)
86 set(_OpenAL_ARCH_DIR libs/Win32 lib/Win32)
89 find_library(OPENAL_LIBRARY
90 NAMES OpenAL al openal OpenAL32
\r
94 PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
\r
96 ~/Library/Frameworks
\r
102 [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
\r
105 unset(_OpenAL_ARCH_DIR)
\r
108 set(OPENAL_LIBRARY "nul" CACHE STRING "emscripten override" FORCE)
\r
109 set(OPENAL_INCLUDE_DIR "${CMAKE_SYSTEM_INCLUDE_PATH}/AL" CACHE STRING "emscripten override" FORCE)
\r
112 # handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
\r
113 # all listed variables are TRUE
\r
114 include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
\r
115 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
\r
117 mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
\r