rlm@0
|
1 # CMake build file list for OpenAL
|
rlm@0
|
2
|
rlm@0
|
3 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
|
rlm@0
|
4
|
rlm@0
|
5 IF(COMMAND CMAKE_POLICY)
|
rlm@0
|
6 CMAKE_POLICY(SET CMP0003 NEW)
|
rlm@0
|
7 ENDIF(COMMAND CMAKE_POLICY)
|
rlm@0
|
8
|
rlm@0
|
9 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
rlm@0
|
10
|
rlm@0
|
11 INCLUDE(CheckFunctionExists)
|
rlm@0
|
12 INCLUDE(CheckLibraryExists)
|
rlm@0
|
13 INCLUDE(CheckSharedFunctionExists)
|
rlm@0
|
14 INCLUDE(CheckIncludeFile)
|
rlm@0
|
15 INCLUDE(CheckIncludeFiles)
|
rlm@0
|
16 INCLUDE(CheckSymbolExists)
|
rlm@0
|
17 INCLUDE(CheckCCompilerFlag)
|
rlm@0
|
18 INCLUDE(CheckCSourceCompiles)
|
rlm@0
|
19 INCLUDE(CheckTypeSize)
|
rlm@0
|
20
|
rlm@0
|
21
|
rlm@0
|
22 PROJECT(OpenAL C)
|
rlm@0
|
23
|
rlm@0
|
24
|
rlm@0
|
25 SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
rlm@0
|
26
|
rlm@0
|
27
|
rlm@0
|
28 OPTION(ALSA "Check for ALSA backend" ON)
|
rlm@0
|
29 OPTION(OSS "Check for OSS backend" ON)
|
rlm@0
|
30 OPTION(SOLARIS "Check for Solaris backend" ON)
|
rlm@0
|
31 OPTION(SNDIO "Check for SndIO backend" ON)
|
rlm@0
|
32 OPTION(MMDEVAPI "Check for MMDevApi" ON)
|
rlm@0
|
33 OPTION(DSOUND "Check for DirectSound backend" ON)
|
rlm@0
|
34 OPTION(WINMM "Check for Windows Multimedia backend" ON)
|
rlm@0
|
35 OPTION(PORTAUDIO "Check for PortAudio backend" ON)
|
rlm@0
|
36 OPTION(PULSEAUDIO "Check for PulseAudio backend" ON)
|
rlm@0
|
37 OPTION(COREAUDIO "Check for CoreAudio backend" ON)
|
rlm@0
|
38 OPTION(OPENSL "Check for OpenSL backend" ON)
|
rlm@0
|
39 OPTION(WAVE "Enable Wave Writer backend" ON)
|
rlm@0
|
40 OPTION(RECORD "Enable Recorder Backend" ON)
|
rlm@0
|
41
|
rlm@0
|
42 OPTION(REQUIRE_ALSA "Require ALSA backend" OFF)
|
rlm@0
|
43 OPTION(REQUIRE_OSS "Require OSS backend" OFF)
|
rlm@0
|
44 OPTION(REQUIRE_SOLARIS "Require Solaris backend" OFF)
|
rlm@0
|
45 OPTION(REQUIRE_SNDIO "Require SndIO backend" OFF)
|
rlm@0
|
46 OPTION(REQUIRE_MMDEVAPI "Require MMDevApi" OFF)
|
rlm@0
|
47 OPTION(REQUIRE_DSOUND "Require DirectSound backend" OFF)
|
rlm@0
|
48 OPTION(REQUIRE_WINMM "Require Windows Multimedia backend" OFF)
|
rlm@0
|
49 OPTION(REQUIRE_PORTAUDIO "Require PortAudio backend" OFF)
|
rlm@0
|
50 OPTION(REQUIRE_PULSEAUDIO "Require PulseAudio backend" OFF)
|
rlm@0
|
51 OPTION(REQUIRE_COREAUDIO "Require CoreAudio backend" OFF)
|
rlm@0
|
52 OPTION(REQUIRE_OPENSL "Require OpenSL backend" OFF)
|
rlm@0
|
53
|
rlm@0
|
54 OPTION(DLOPEN "Check for the dlopen API for loading optional libs" ON)
|
rlm@0
|
55
|
rlm@0
|
56 OPTION(WERROR "Treat compile warnings as errors" OFF)
|
rlm@0
|
57
|
rlm@0
|
58 OPTION(UTILS "Build and install utility programs" ON)
|
rlm@0
|
59
|
rlm@0
|
60 OPTION(ALSOFT_CONFIG "Install alsoft.conf configuration file" OFF)
|
rlm@0
|
61
|
rlm@0
|
62
|
rlm@0
|
63 SET(LIBNAME openal)
|
rlm@0
|
64
|
rlm@0
|
65 SET(LIBTYPE SHARED)
|
rlm@0
|
66
|
rlm@0
|
67 SET(LIB_MAJOR_VERSION "1")
|
rlm@0
|
68 SET(LIB_MINOR_VERSION "13")
|
rlm@0
|
69 SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}")
|
rlm@0
|
70
|
rlm@0
|
71 SET(EXPORT_DECL "")
|
rlm@0
|
72
|
rlm@0
|
73
|
rlm@0
|
74 # Add definitions, compiler switches, etc.
|
rlm@0
|
75 INCLUDE_DIRECTORIES(OpenAL32/Include include "${OpenAL_BINARY_DIR}")
|
rlm@0
|
76
|
rlm@0
|
77 ADD_DEFINITIONS(-Winline -Wall)
|
rlm@0
|
78 CHECK_C_COMPILER_FLAG(-Wextra HAVE_W_EXTRA)
|
rlm@0
|
79 IF(HAVE_W_EXTRA)
|
rlm@0
|
80 ADD_DEFINITIONS(-Wextra)
|
rlm@0
|
81 ENDIF()
|
rlm@0
|
82
|
rlm@0
|
83 IF(WERROR)
|
rlm@0
|
84 ADD_DEFINITIONS(-Werror)
|
rlm@0
|
85 ENDIF()
|
rlm@0
|
86
|
rlm@0
|
87 SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -D_DEBUG" CACHE STRING
|
rlm@0
|
88 "Flags used by the compiler during Release with Debug Info builds."
|
rlm@0
|
89 FORCE)
|
rlm@0
|
90 SET(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG" CACHE STRING
|
rlm@0
|
91 "Flags used by the compiler during release minsize builds."
|
rlm@0
|
92 FORCE)
|
rlm@0
|
93 SET(CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer -DNDEBUG" CACHE STRING
|
rlm@0
|
94 "Flags used by the compiler during release builds"
|
rlm@0
|
95 FORCE)
|
rlm@0
|
96 SET(CMAKE_C_FLAGS_DEBUG "-g3 -D_DEBUG" CACHE STRING
|
rlm@0
|
97 "Flags used by the compiler during debug builds."
|
rlm@0
|
98 FORCE)
|
rlm@0
|
99
|
rlm@0
|
100 CHECK_INCLUDE_FILE(fenv.h HAVE_FENV_H)
|
rlm@0
|
101 CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
|
rlm@0
|
102 CHECK_INCLUDE_FILE(ieeefp.h HAVE_IEEEFP_H)
|
rlm@0
|
103 CHECK_INCLUDE_FILE(guiddef.h HAVE_GUIDDEF_H)
|
rlm@0
|
104 IF(NOT HAVE_GUIDDEF_H)
|
rlm@0
|
105 CHECK_INCLUDE_FILE(initguid.h HAVE_INITGUID_H)
|
rlm@0
|
106 ENDIF()
|
rlm@0
|
107 CHECK_INCLUDE_FILE(arm_neon.h HAVE_ARM_NEON_H)
|
rlm@0
|
108
|
rlm@0
|
109 CHECK_LIBRARY_EXISTS(m powf "" HAVE_POWF)
|
rlm@0
|
110 CHECK_LIBRARY_EXISTS(m sqrtf "" HAVE_SQRTF)
|
rlm@0
|
111 CHECK_LIBRARY_EXISTS(m acosf "" HAVE_ACOSF)
|
rlm@0
|
112 CHECK_LIBRARY_EXISTS(m atanf "" HAVE_ATANF)
|
rlm@0
|
113 CHECK_LIBRARY_EXISTS(m fabsf "" HAVE_FABSF)
|
rlm@0
|
114 IF(HAVE_FENV_H)
|
rlm@0
|
115 CHECK_LIBRARY_EXISTS(m fesetround "" HAVE_FESETROUND)
|
rlm@0
|
116 ENDIF()
|
rlm@0
|
117 IF(HAVE_SQRTF OR HAVE_ACOSF OR HAVE_ATANF OR HAVE_FABSF OR HAVE_FESETROUND)
|
rlm@0
|
118 SET(EXTRA_LIBS m ${EXTRA_LIBS})
|
rlm@0
|
119 ENDIF()
|
rlm@0
|
120 CHECK_FUNCTION_EXISTS(strtof HAVE_STRTOF)
|
rlm@0
|
121 CHECK_FUNCTION_EXISTS(_controlfp HAVE__CONTROLFP)
|
rlm@0
|
122
|
rlm@0
|
123 CHECK_FUNCTION_EXISTS(stat HAVE_STAT)
|
rlm@0
|
124 CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
|
rlm@0
|
125 IF(NOT HAVE_STRCASECMP)
|
rlm@0
|
126 CHECK_FUNCTION_EXISTS(_stricmp HAVE__STRICMP)
|
rlm@0
|
127 IF(NOT HAVE__STRICMP)
|
rlm@0
|
128 MESSAGE(FATAL_ERROR "No case-insensitive compare function found, please report!")
|
rlm@0
|
129 ENDIF()
|
rlm@0
|
130
|
rlm@0
|
131 ADD_DEFINITIONS(-Dstrcasecmp=_stricmp)
|
rlm@0
|
132 ENDIF()
|
rlm@0
|
133
|
rlm@0
|
134 CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
|
rlm@0
|
135 IF(NOT HAVE_STRNCASECMP)
|
rlm@0
|
136 CHECK_FUNCTION_EXISTS(_strnicmp HAVE__STRNICMP)
|
rlm@0
|
137 IF(NOT HAVE__STRNICMP)
|
rlm@0
|
138 MESSAGE(FATAL_ERROR "No case-insensitive size-limitted compare function found, please report!")
|
rlm@0
|
139 ENDIF()
|
rlm@0
|
140
|
rlm@0
|
141 ADD_DEFINITIONS(-Dstrncasecmp=_strnicmp)
|
rlm@0
|
142 ENDIF()
|
rlm@0
|
143
|
rlm@0
|
144 CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
|
rlm@0
|
145 IF(NOT HAVE_SNPRINTF)
|
rlm@0
|
146 CHECK_FUNCTION_EXISTS(_snprintf HAVE__SNPRINTF)
|
rlm@0
|
147 IF(NOT HAVE__SNPRINTF)
|
rlm@0
|
148 MESSAGE(FATAL_ERROR "No snprintf function found, please report!")
|
rlm@0
|
149 ENDIF()
|
rlm@0
|
150
|
rlm@0
|
151 ADD_DEFINITIONS(-Dsnprintf=_snprintf)
|
rlm@0
|
152 ENDIF()
|
rlm@0
|
153
|
rlm@0
|
154 CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF)
|
rlm@0
|
155 IF(NOT HAVE_VSNPRINTF)
|
rlm@0
|
156 CHECK_FUNCTION_EXISTS(_vsnprintf HAVE__VSNPRINTF)
|
rlm@0
|
157 IF(NOT HAVE__VSNPRINTF)
|
rlm@0
|
158 MESSAGE(FATAL_ERROR "No vsnprintf function found, please report!")
|
rlm@0
|
159 ENDIF()
|
rlm@0
|
160
|
rlm@0
|
161 ADD_DEFINITIONS(-Dvsnprintf=_vsnprintf)
|
rlm@0
|
162 ENDIF()
|
rlm@0
|
163
|
rlm@0
|
164 CHECK_SYMBOL_EXISTS(isfinite math.h HAVE_ISFINITE)
|
rlm@0
|
165 IF(NOT HAVE_ISFINITE)
|
rlm@0
|
166 CHECK_FUNCTION_EXISTS(finite HAVE_FINITE)
|
rlm@0
|
167 IF(NOT HAVE_FINITE)
|
rlm@0
|
168 CHECK_FUNCTION_EXISTS(_finite HAVE__FINITE)
|
rlm@0
|
169 IF(NOT HAVE__FINITE)
|
rlm@0
|
170 MESSAGE(FATAL_ERROR "No isfinite function found, please report!")
|
rlm@0
|
171 ENDIF()
|
rlm@0
|
172 ADD_DEFINITIONS(-Disfinite=_finite)
|
rlm@0
|
173 ELSE()
|
rlm@0
|
174 ADD_DEFINITIONS(-Disfinite=finite)
|
rlm@0
|
175 ENDIF()
|
rlm@0
|
176 ENDIF()
|
rlm@0
|
177
|
rlm@0
|
178 CHECK_SYMBOL_EXISTS(isnan math.h HAVE_ISNAN)
|
rlm@0
|
179 IF(NOT HAVE_ISNAN)
|
rlm@0
|
180 CHECK_FUNCTION_EXISTS(_isnan HAVE__ISNAN)
|
rlm@0
|
181 IF(NOT HAVE__ISNAN)
|
rlm@0
|
182 MESSAGE(FATAL_ERROR "No isnan function found, please report!")
|
rlm@0
|
183 ENDIF()
|
rlm@0
|
184
|
rlm@0
|
185 ADD_DEFINITIONS(-Disnan=_isnan)
|
rlm@0
|
186 ENDIF()
|
rlm@0
|
187
|
rlm@0
|
188
|
rlm@0
|
189 # Check for the dlopen API (for dynamicly loading backend libs)
|
rlm@0
|
190 IF(DLOPEN)
|
rlm@0
|
191 CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
|
rlm@0
|
192 IF(HAVE_DLFCN_H)
|
rlm@0
|
193 CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
|
rlm@0
|
194 IF(HAVE_LIBDL)
|
rlm@0
|
195 SET(EXTRA_LIBS dl ${EXTRA_LIBS})
|
rlm@0
|
196 ENDIF()
|
rlm@0
|
197 ENDIF()
|
rlm@0
|
198 ENDIF()
|
rlm@0
|
199
|
rlm@0
|
200 # Check if we have Windows headers
|
rlm@0
|
201 CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H -D_WIN32_WINNT=0x0500)
|
rlm@0
|
202 IF(NOT HAVE_WINDOWS_H)
|
rlm@0
|
203 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
|
rlm@0
|
204 IF(NOT HAVE_GETTIMEOFDAY)
|
rlm@0
|
205 MESSAGE(FATAL_ERROR "No timing function found!")
|
rlm@0
|
206 ENDIF()
|
rlm@0
|
207
|
rlm@0
|
208 CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
|
rlm@0
|
209 IF(NOT HAVE_NANOSLEEP)
|
rlm@0
|
210 MESSAGE(FATAL_ERROR "No sleep function found!")
|
rlm@0
|
211 ENDIF()
|
rlm@0
|
212
|
rlm@0
|
213 CHECK_C_COMPILER_FLAG(-pthread HAVE_PTHREAD)
|
rlm@0
|
214 IF(HAVE_PTHREAD)
|
rlm@0
|
215 ADD_DEFINITIONS(-pthread)
|
rlm@0
|
216 SET(EXTRA_LIBS ${EXTRA_LIBS} -pthread)
|
rlm@0
|
217 ENDIF()
|
rlm@0
|
218
|
rlm@0
|
219 # We need pthreads outside of Windows
|
rlm@0
|
220 CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
|
rlm@0
|
221 IF(NOT HAVE_PTHREAD_H)
|
rlm@0
|
222 MESSAGE(FATAL_ERROR "PThreads is required for non-Windows builds!")
|
rlm@0
|
223 ENDIF()
|
rlm@0
|
224 # Some systems need pthread_np.h to get recursive mutexes
|
rlm@0
|
225 CHECK_INCLUDE_FILES("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H)
|
rlm@0
|
226
|
rlm@0
|
227 # _GNU_SOURCE is needed on some systems for extra attributes, and
|
rlm@0
|
228 # _REENTRANT is needed for libc thread-safety
|
rlm@0
|
229 ADD_DEFINITIONS(-D_GNU_SOURCE=1)
|
rlm@0
|
230 CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_LIBPTHREAD)
|
rlm@0
|
231 IF(HAVE_LIBPTHREAD)
|
rlm@0
|
232 SET(EXTRA_LIBS pthread ${EXTRA_LIBS})
|
rlm@0
|
233 ENDIF()
|
rlm@0
|
234
|
rlm@0
|
235 CHECK_LIBRARY_EXISTS(pthread pthread_setschedparam "" HAVE_PTHREAD_SETSCHEDPARAM)
|
rlm@0
|
236
|
rlm@0
|
237 CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_LIBRT)
|
rlm@0
|
238 IF(HAVE_LIBRT)
|
rlm@0
|
239 SET(EXTRA_LIBS rt ${EXTRA_LIBS})
|
rlm@0
|
240 ENDIF()
|
rlm@0
|
241 ENDIF()
|
rlm@0
|
242
|
rlm@0
|
243 # Check for a 64-bit type
|
rlm@0
|
244 CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
|
rlm@0
|
245 IF(NOT HAVE_STDINT_H)
|
rlm@0
|
246 IF(HAVE_WINDOWS_H)
|
rlm@0
|
247 CHECK_C_SOURCE_COMPILES("\#define _WIN32_WINNT 0x0500
|
rlm@0
|
248 \#include <windows.h>
|
rlm@0
|
249 __int64 foo;
|
rlm@0
|
250 int main() {return 0;}" HAVE___INT64)
|
rlm@0
|
251 ENDIF()
|
rlm@0
|
252 IF(NOT HAVE___INT64)
|
rlm@0
|
253 IF(NOT SIZEOF_LONG MATCHES "8")
|
rlm@0
|
254 IF(NOT SIZEOF_LONG_LONG MATCHES "8")
|
rlm@0
|
255 MESSAGE(FATAL_ERROR "No 64-bit types found, please report!")
|
rlm@0
|
256 ENDIF()
|
rlm@0
|
257 ENDIF()
|
rlm@0
|
258 ENDIF()
|
rlm@0
|
259 ENDIF()
|
rlm@0
|
260
|
rlm@0
|
261 # Windows needs winmm for timeGetTime, even if the backend is disabled
|
rlm@0
|
262 CHECK_SHARED_FUNCTION_EXISTS(timeGetTime "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
|
rlm@0
|
263 IF(HAVE_LIBWINMM)
|
rlm@0
|
264 SET(EXTRA_LIBS winmm ${EXTRA_LIBS})
|
rlm@0
|
265 SET(PKG_CONFIG_LIBS ${PKG_CONFIG_LIBS} -lwinmm)
|
rlm@0
|
266 ENDIF()
|
rlm@0
|
267
|
rlm@0
|
268
|
rlm@0
|
269 SET(OPENAL_OBJS OpenAL32/alAuxEffectSlot.c
|
rlm@0
|
270 OpenAL32/alBuffer.c
|
rlm@0
|
271 OpenAL32/alEffect.c
|
rlm@0
|
272 OpenAL32/alError.c
|
rlm@0
|
273 OpenAL32/alExtension.c
|
rlm@0
|
274 OpenAL32/alFilter.c
|
rlm@0
|
275 OpenAL32/alListener.c
|
rlm@0
|
276 OpenAL32/alSource.c
|
rlm@0
|
277 OpenAL32/alState.c
|
rlm@0
|
278 OpenAL32/alThunk.c
|
rlm@0
|
279 )
|
rlm@0
|
280 SET(ALC_OBJS Alc/ALc.c
|
rlm@0
|
281 Alc/ALu.c
|
rlm@0
|
282 Alc/alcConfig.c
|
rlm@0
|
283 Alc/alcDedicated.c
|
rlm@0
|
284 Alc/alcEcho.c
|
rlm@0
|
285 Alc/alcModulator.c
|
rlm@0
|
286 Alc/alcReverb.c
|
rlm@0
|
287 Alc/alcRing.c
|
rlm@0
|
288 Alc/alcThread.c
|
rlm@0
|
289 Alc/bs2b.c
|
rlm@0
|
290 Alc/helpers.c
|
rlm@0
|
291 Alc/hrtf.c
|
rlm@0
|
292 Alc/mixer.c
|
rlm@0
|
293 Alc/panning.c
|
rlm@0
|
294 # Default backends, always available
|
rlm@0
|
295 Alc/backends/loopback.c
|
rlm@0
|
296 Alc/backends/null.c
|
rlm@0
|
297 # RLM: add record device
|
rlm@0
|
298 Alc/backends/record.c
|
rlm@0
|
299 )
|
rlm@0
|
300
|
rlm@0
|
301 SET(BACKENDS "")
|
rlm@0
|
302 SET(HAVE_ALSA 0)
|
rlm@0
|
303 SET(HAVE_OSS 0)
|
rlm@0
|
304 SET(HAVE_SOLARIS 0)
|
rlm@0
|
305 SET(HAVE_SNDIO 0)
|
rlm@0
|
306 SET(HAVE_DSOUND 0)
|
rlm@0
|
307 SET(HAVE_WINMM 0)
|
rlm@0
|
308 SET(HAVE_PORTAUDIO 0)
|
rlm@0
|
309 SET(HAVE_PULSEAUDIO 0)
|
rlm@0
|
310 SET(HAVE_COREAUDIO 0)
|
rlm@0
|
311 SET(HAVE_OPENSL 0)
|
rlm@0
|
312 SET(HAVE_WAVE 0)
|
rlm@0
|
313
|
rlm@0
|
314
|
rlm@0
|
315 # Check for MMDevApi backend
|
rlm@0
|
316 IF(HAVE_WINDOWS_H)
|
rlm@0
|
317 IF(MMDEVAPI)
|
rlm@0
|
318 CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
|
rlm@0
|
319 IF(HAVE_MMDEVICEAPI_H)
|
rlm@0
|
320 SET(HAVE_MMDEVAPI 1)
|
rlm@0
|
321 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/mmdevapi.c)
|
rlm@0
|
322
|
rlm@0
|
323 SET(BACKENDS "${BACKENDS} MMDevApi,")
|
rlm@0
|
324 ENDIF()
|
rlm@0
|
325 ENDIF()
|
rlm@0
|
326 ENDIF()
|
rlm@0
|
327 IF(REQUIRE_MMDEVAPI AND NOT HAVE_MMDEVAPI)
|
rlm@0
|
328 MESSAGE(FATAL_ERROR "Failed to enabled required MMDevApi backend")
|
rlm@0
|
329 ENDIF()
|
rlm@0
|
330
|
rlm@0
|
331
|
rlm@0
|
332 IF(HAVE_WINDOWS_H)
|
rlm@0
|
333 IF(WINMM)
|
rlm@0
|
334 CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0500)
|
rlm@0
|
335 IF(HAVE_MMSYSTEM_H AND HAVE_LIBWINMM)
|
rlm@0
|
336 SET(HAVE_WINMM 1)
|
rlm@0
|
337 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/winmm.c)
|
rlm@0
|
338 SET(BACKENDS "${BACKENDS} WinMM,")
|
rlm@0
|
339 ENDIF()
|
rlm@0
|
340 ENDIF()
|
rlm@0
|
341 ENDIF()
|
rlm@0
|
342 IF(REQUIRE_WINMM AND NOT HAVE_WINMM)
|
rlm@0
|
343 MESSAGE(FATAL_ERROR "Failed to enable required WinMM backend")
|
rlm@0
|
344 ENDIF()
|
rlm@0
|
345
|
rlm@0
|
346 # Optionally enable the Wave Writer backend
|
rlm@0
|
347 IF(WAVE)
|
rlm@0
|
348 SET(HAVE_WAVE 1)
|
rlm@0
|
349 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/wave.c)
|
rlm@0
|
350 SET(BACKENDS "${BACKENDS} WaveFile,")
|
rlm@0
|
351 ENDIF()
|
rlm@0
|
352
|
rlm@0
|
353
|
rlm@0
|
354 # RLM: enable the record backend
|
rlm@0
|
355 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/record.c)
|
rlm@0
|
356 SET(BACKENDS "${BACKENDS} Record,")
|
rlm@0
|
357
|
rlm@0
|
358
|
rlm@0
|
359 # This is always available
|
rlm@0
|
360 SET(BACKENDS "${BACKENDS} Null")
|
rlm@0
|
361
|
rlm@0
|
362 # Needed for openal.pc.in
|
rlm@0
|
363 SET(prefix ${CMAKE_INSTALL_PREFIX})
|
rlm@0
|
364 SET(exec_prefix "\${prefix}")
|
rlm@0
|
365 SET(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
|
rlm@0
|
366 SET(bindir "\${exec_prefix}/bin")
|
rlm@0
|
367 SET(includedir "\${prefix}/include")
|
rlm@0
|
368 SET(PACKAGE_VERSION "${LIB_VERSION}")
|
rlm@0
|
369
|
rlm@0
|
370 # End configuration
|
rlm@0
|
371 CONFIGURE_FILE(
|
rlm@0
|
372 "${OpenAL_SOURCE_DIR}/config.h.in"
|
rlm@0
|
373 "${OpenAL_BINARY_DIR}/config.h")
|
rlm@0
|
374 CONFIGURE_FILE(
|
rlm@0
|
375 "${OpenAL_SOURCE_DIR}/openal.pc.in"
|
rlm@0
|
376 "${OpenAL_BINARY_DIR}/openal.pc"
|
rlm@0
|
377 @ONLY)
|
rlm@0
|
378
|
rlm@0
|
379
|
rlm@0
|
380 # RLM link jni the dumb way for now:
|
rlm@0
|
381 INCLUDE_DIRECTORIES("/usr/lib/jvm/java-6-sun-1.6.0.20/include/")
|
rlm@0
|
382 INCLUDE_DIRECTORIES("/usr/lib/jvm/java-6-sun-1.6.0.20/include/linux")
|
rlm@0
|
383
|
rlm@0
|
384
|
rlm@0
|
385 # Build a library
|
rlm@0
|
386 ADD_LIBRARY(${LIBNAME} SHARED ${OPENAL_OBJS} ${ALC_OBJS})
|
rlm@0
|
387 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES DEFINE_SYMBOL AL_BUILD_LIBRARY
|
rlm@0
|
388 COMPILE_FLAGS -DAL_ALEXT_PROTOTYPES
|
rlm@0
|
389 VERSION ${LIB_VERSION}.0
|
rlm@0
|
390 SOVERSION ${LIB_MAJOR_VERSION})
|
rlm@0
|
391
|
rlm@0
|
392
|
rlm@0
|
393 TARGET_LINK_LIBRARIES(${LIBNAME} ${EXTRA_LIBS})
|
rlm@0
|
394
|
rlm@0
|
395 # Add an install target here
|
rlm@0
|
396 INSTALL(TARGETS ${LIBNAME}
|
rlm@0
|
397 RUNTIME DESTINATION bin
|
rlm@0
|
398 LIBRARY DESTINATION "lib${LIB_SUFFIX}"
|
rlm@0
|
399 ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
|
rlm@0
|
400 )
|
rlm@0
|
401 INSTALL(FILES include/AL/al.h
|
rlm@0
|
402 include/AL/alc.h
|
rlm@0
|
403 include/AL/alext.h
|
rlm@0
|
404 include/AL/efx.h
|
rlm@0
|
405 include/AL/efx-creative.h
|
rlm@0
|
406 DESTINATION include/AL
|
rlm@0
|
407 )
|
rlm@0
|
408 INSTALL(FILES "${OpenAL_BINARY_DIR}/openal.pc"
|
rlm@0
|
409 DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
|
rlm@0
|
410
|
rlm@0
|
411
|
rlm@0
|
412 MESSAGE(STATUS "")
|
rlm@0
|
413 MESSAGE(STATUS "Building OpenAL with support for the following backends:")
|
rlm@0
|
414 MESSAGE(STATUS " ${BACKENDS}")
|
rlm@0
|
415 MESSAGE(STATUS "")
|
rlm@0
|
416
|
rlm@0
|
417 # Install alsoft.conf configuration file
|
rlm@0
|
418
|
rlm@0
|
419 IF(UTILS)
|
rlm@0
|
420 ADD_EXECUTABLE(openal-info utils/openal-info.c)
|
rlm@0
|
421 TARGET_LINK_LIBRARIES(openal-info ${LIBNAME})
|
rlm@0
|
422 INSTALL(TARGETS openal-info
|
rlm@0
|
423 RUNTIME DESTINATION bin
|
rlm@0
|
424 LIBRARY DESTINATION "lib${LIB_SUFFIX}"
|
rlm@0
|
425 ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
|
rlm@0
|
426 )
|
rlm@0
|
427 MESSAGE(STATUS "Building utility programs")
|
rlm@0
|
428 MESSAGE(STATUS "")
|
rlm@0
|
429 ENDIF()
|
rlm@0
|
430
|
rlm@0
|
431
|