diff options
Diffstat (limited to 'linden/indra/cmake/OPENAL.cmake')
-rw-r--r-- | linden/indra/cmake/OPENAL.cmake | 125 |
1 files changed, 105 insertions, 20 deletions
diff --git a/linden/indra/cmake/OPENAL.cmake b/linden/indra/cmake/OPENAL.cmake index eb195a0..94fa75d 100644 --- a/linden/indra/cmake/OPENAL.cmake +++ b/linden/indra/cmake/OPENAL.cmake | |||
@@ -1,28 +1,113 @@ | |||
1 | # -*- cmake -*- | 1 | # -*- cmake -*- |
2 | |||
3 | include(Variables) | ||
2 | include(Linking) | 4 | include(Linking) |
3 | include(Prebuilt) | ||
4 | 5 | ||
5 | if (LINUX) | 6 | set(OPENAL ON CACHE BOOL "Enable OpenAL") |
6 | set(OPENAL ON CACHE BOOL "Enable OpenAL") | 7 | |
7 | else (LINUX) | ||
8 | set(OPENAL OFF CACHE BOOL "Enable OpenAL") | ||
9 | endif (LINUX) | ||
10 | 8 | ||
11 | if (OPENAL) | 9 | if (OPENAL) |
12 | if (STANDALONE) | 10 | |
13 | include(FindPkgConfig) | 11 | # message(STATUS "Building with OpenAL audio support") |
14 | include(FindOpenAL) | 12 | |
15 | pkg_check_modules(OPENAL_LIB REQUIRED openal) | 13 | # OPENAL_LIB |
16 | pkg_check_modules(FREEALUT_LIB REQUIRED freealut) | 14 | |
17 | else (STANDALONE) | 15 | if (WINDOWS) |
18 | use_prebuilt_binary(openal) | 16 | find_library(OPENAL_LIB |
19 | endif (STANDALONE) | 17 | NAMES openal32 |
20 | set(OPENAL_LIBRARIES | 18 | PATHS ${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release |
21 | openal | 19 | ) |
22 | alut | 20 | elseif (DARWIN) |
21 | # Look for for system's OpenAL.framework | ||
22 | find_library(OPENAL_LIB | ||
23 | NAMES openal.1 | ||
24 | PATHS ${ARCH_PREBUILT_DIRS_RELEASE} | ||
25 | NO_DEFAULT_PATH | ||
26 | ) | ||
27 | else (WINDOWS) | ||
28 | set(OPENAL_LIB openal) | ||
29 | endif (WINDOWS) | ||
30 | |||
31 | if (NOT OPENAL_LIB) | ||
32 | message(FATAL_ERROR "OpenAL not found!") | ||
33 | else (NOT OPENAL_LIB) | ||
34 | # message(STATUS "OpenAL found: ${OPENAL_LIB}") | ||
35 | endif (NOT OPENAL_LIB) | ||
36 | |||
37 | |||
38 | |||
39 | # OPENAL_INCLUDE_DIR | ||
40 | |||
41 | if (DARWIN) | ||
42 | set(OPENAL_INCLUDE_DIR "${LIBS_PREBUILT_DIR}/include/AL") | ||
43 | else (DARWIN) | ||
44 | find_path(OPENAL_INCLUDE_DIR | ||
45 | NAMES al.h | ||
46 | PATHS ${LIBS_PREBUILT_DIR}/include/AL | ||
47 | ) | ||
48 | endif (DARWIN) | ||
49 | |||
50 | if (NOT OPENAL_INCLUDE_DIR) | ||
51 | message(FATAL_ERROR "al.h not found!") | ||
52 | else (NOT OPENAL_INCLUDE_DIR) | ||
53 | # message(STATUS "al.h found in: ${OPENAL_INCLUDE_DIR}") | ||
54 | endif (NOT OPENAL_INCLUDE_DIR) | ||
55 | |||
56 | |||
57 | |||
58 | # ALUT_LIB | ||
59 | |||
60 | if (WINDOWS) | ||
61 | find_library(ALUT_LIB | ||
62 | NAMES alut freealut | ||
63 | PATHS ${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release | ||
64 | ) | ||
65 | elseif (DARWIN) | ||
66 | find_library( ALUT_LIB | ||
67 | NAMES alut.0 | ||
68 | PATHS ${ARCH_PREBUILT_DIRS_RELEASE} | ||
69 | NO_DEFAULT_PATH | ||
70 | ) | ||
71 | else (WINDOWS) | ||
72 | set(ALUT_LIB alut) | ||
73 | endif (WINDOWS) | ||
74 | |||
75 | if (NOT ALUT_LIB) | ||
76 | message(FATAL_ERROR "ALUT not found!") | ||
77 | else (NOT ALUT_LIB) | ||
78 | # message(STATUS "ALUT found: ${ALUT_LIB}") | ||
79 | endif (NOT ALUT_LIB) | ||
80 | |||
81 | |||
82 | |||
83 | # ALUT_INCLUDE_DIR | ||
84 | |||
85 | find_path(ALUT_INCLUDE_DIR | ||
86 | NAMES alut.h | ||
87 | PATHS ${LIBS_PREBUILT_DIR}/include/AL | ||
88 | ) | ||
89 | |||
90 | if (NOT ALUT_INCLUDE_DIR) | ||
91 | message(FATAL_ERROR "alut.h not found!") | ||
92 | else (NOT ALUT_INCLUDE_DIR) | ||
93 | # message(STATUS "alut.h found in: ${ALUT_INCLUDE_DIR}") | ||
94 | endif (NOT ALUT_INCLUDE_DIR) | ||
95 | |||
96 | |||
97 | |||
98 | set(OPENAL_LIBRARIES | ||
99 | ${OPENAL_LIB} | ||
100 | ${ALUT_LIB} | ||
101 | ) | ||
102 | |||
103 | set(OPENAL_INCLUDE_DIRS | ||
104 | ${OPENAL_INCLUDE_DIR} | ||
105 | ${ALUT_INCLUDE_DIR} | ||
106 | ) | ||
107 | |||
108 | |||
109 | set(OPENAL_FOUND TRUE CACHE BOOL | ||
110 | "Found OpenAL and ALUT libraries successfully" | ||
23 | ) | 111 | ) |
24 | endif (OPENAL) | ||
25 | 112 | ||
26 | if (OPENAL) | ||
27 | message(STATUS "Building with OpenAL audio support") | ||
28 | endif (OPENAL) | 113 | endif (OPENAL) |