aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/cmake/OPENAL.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/cmake/OPENAL.cmake')
-rw-r--r--linden/indra/cmake/OPENAL.cmake85
1 files changed, 85 insertions, 0 deletions
diff --git a/linden/indra/cmake/OPENAL.cmake b/linden/indra/cmake/OPENAL.cmake
new file mode 100644
index 0000000..a2bae5d
--- /dev/null
+++ b/linden/indra/cmake/OPENAL.cmake
@@ -0,0 +1,85 @@
1# -*- cmake -*-
2
3set(OPENAL ON CACHE BOOL "Enable OpenAL")
4
5
6if (OPENAL)
7
8 # message(STATUS "Building with OpenAL audio support")
9
10 # OPENAL_LIB
11
12 find_library(OPENAL_LIB
13 NAMES openal OpenAL OpenAL32 wrap_oal
14 PATHS ${ARCH_PREBUILT_DIRS_RELEASE}
15 )
16
17 if (NOT OPENAL_LIB)
18 message(FATAL_ERROR "OpenAL not found!")
19 else (NOT OPENAL_LIB)
20 # message(STATUS "OpenAL found: ${OPENAL_LIB}")
21 endif (NOT OPENAL_LIB)
22
23
24
25 # OPENAL_INCLUDE_DIR
26
27 find_path(OPENAL_INCLUDE_DIR
28 NAMES al.h
29 PATHS ${LIBS_PREBUILT_DIR}/include /usr/include/AL
30 )
31
32 if (NOT OPENAL_INCLUDE_DIR)
33 message(FATAL_ERROR "al.h not found!")
34 else (NOT OPENAL_INCLUDE_DIR)
35 # message(STATUS "al.h found in: ${OPENAL_INCLUDE_DIR}")
36 endif (NOT OPENAL_INCLUDE_DIR)
37
38
39
40 # ALUT_LIB
41
42 find_library(ALUT_LIB
43 NAMES alut freealut
44 PATHS ${ARCH_PREBUILT_DIRS_RELEASE}
45 )
46
47 if (NOT ALUT_LIB)
48 message(FATAL_ERROR "ALUT not found!")
49 else (NOT ALUT_LIB)
50 # message(STATUS "ALUT found: ${ALUT_LIB}")
51 endif (NOT ALUT_LIB)
52
53
54
55 # ALUT_INCLUDE_DIR
56
57 find_path(ALUT_INCLUDE_DIR
58 NAMES alut.h
59 PATHS ${LIBS_PREBUILT_DIR}/include /usr/include/AL
60 )
61
62 if (NOT ALUT_INCLUDE_DIR)
63 message(FATAL_ERROR "alut.h not found!")
64 else (NOT ALUT_INCLUDE_DIR)
65 # message(STATUS "alut.h found in: ${ALUT_INCLUDE_DIR}")
66 endif (NOT ALUT_INCLUDE_DIR)
67
68
69
70 set(OPENAL_LIBRARIES
71 ${OPENAL_LIB}
72 ${ALUT_LIB}
73 )
74
75 set(OPENAL_INCLUDE_DIRS
76 ${OPENAL_INCLUDE_DIR}
77 ${ALUT_INCLUDE_DIR}
78 )
79
80
81 set(OPENAL_FOUND TRUE CACHE BOOL
82 "Found OpenAL and ALUT libraries successfully"
83 )
84
85endif (OPENAL)