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(SEND "Enable Send 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 IF(WIN32)
|
rlm@0
|
64 SET(LIBNAME OpenAL32)
|
rlm@0
|
65 ADD_DEFINITIONS("-D_WIN32")
|
rlm@0
|
66 ELSE()
|
rlm@0
|
67 SET(LIBNAME openal)
|
rlm@0
|
68 ENDIF()
|
rlm@0
|
69
|
rlm@0
|
70 IF(NOT LIBTYPE)
|
rlm@0
|
71 SET(LIBTYPE SHARED)
|
rlm@0
|
72 ENDIF()
|
rlm@0
|
73
|
rlm@0
|
74 SET(LIB_MAJOR_VERSION "1")
|
rlm@0
|
75 SET(LIB_MINOR_VERSION "13")
|
rlm@0
|
76 SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}")
|
rlm@0
|
77
|
rlm@0
|
78 SET(EXPORT_DECL "")
|
rlm@0
|
79
|
rlm@0
|
80
|
rlm@0
|
81 CHECK_TYPE_SIZE("long" SIZEOF_LONG)
|
rlm@0
|
82 CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
|
rlm@0
|
83 CHECK_TYPE_SIZE("unsigned int" SIZEOF_UINT)
|
rlm@0
|
84 CHECK_TYPE_SIZE("void*" SIZEOF_VOIDP)
|
rlm@0
|
85
|
rlm@0
|
86
|
rlm@0
|
87 CHECK_C_SOURCE_COMPILES("int *restrict foo;
|
rlm@0
|
88 int main() {return 0;}" HAVE_RESTRICT)
|
rlm@0
|
89 CHECK_C_SOURCE_COMPILES("int *__restrict foo;
|
rlm@0
|
90 int main() {return 0;}" HAVE___RESTRICT)
|
rlm@0
|
91
|
rlm@0
|
92
|
rlm@0
|
93 # Add definitions, compiler switches, etc.
|
rlm@0
|
94 INCLUDE_DIRECTORIES(OpenAL32/Include include "${OpenAL_BINARY_DIR}")
|
rlm@0
|
95
|
rlm@0
|
96 IF(NOT CMAKE_BUILD_TYPE)
|
rlm@0
|
97 SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
|
rlm@0
|
98 "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
|
rlm@0
|
99 FORCE)
|
rlm@0
|
100 ENDIF()
|
rlm@0
|
101 IF(NOT CMAKE_DEBUG_POSTFIX)
|
rlm@0
|
102 SET(CMAKE_DEBUG_POSTFIX "" CACHE STRING
|
rlm@0
|
103 "Library postfix for debug builds. Normally left blank."
|
rlm@0
|
104 FORCE)
|
rlm@0
|
105 ENDIF()
|
rlm@0
|
106
|
rlm@0
|
107
|
rlm@0
|
108
|
rlm@0
|
109 IF(MSVC)
|
rlm@0
|
110 # ???
|
rlm@0
|
111 SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -D_DEBUG")
|
rlm@0
|
112 SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DNDEBUG")
|
rlm@0
|
113 SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG")
|
rlm@0
|
114 SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
|
rlm@0
|
115 ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
rlm@0
|
116 ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)
|
rlm@0
|
117
|
rlm@0
|
118 IF(NOT DXSDK_DIR)
|
rlm@0
|
119 STRING(REGEX REPLACE "\\\\" "/" DXSDK_DIR "$ENV{DXSDK_DIR}")
|
rlm@0
|
120 ELSE()
|
rlm@0
|
121 STRING(REGEX REPLACE "\\\\" "/" DXSDK_DIR "${DXSDK_DIR}")
|
rlm@0
|
122 ENDIF()
|
rlm@0
|
123 IF(DXSDK_DIR)
|
rlm@0
|
124 MESSAGE(STATUS "Using DirectX SDK directory: ${DXSDK_DIR}")
|
rlm@0
|
125 SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} "${DXSDK_DIR}/Include")
|
rlm@0
|
126 INCLUDE_DIRECTORIES("${DXSDK_DIR}/Include")
|
rlm@0
|
127 LINK_DIRECTORIES("${DXSDK_DIR}/Lib")
|
rlm@0
|
128 ENDIF()
|
rlm@0
|
129
|
rlm@0
|
130 OPTION(FORCE_STATIC_VCRT "Force /MT for static VC runtimes" OFF)
|
rlm@0
|
131 IF(FORCE_STATIC_VCRT)
|
rlm@0
|
132 FOREACH(flag_var
|
rlm@0
|
133 CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
rlm@0
|
134 CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
|
rlm@0
|
135 IF(${flag_var} MATCHES "/MD")
|
rlm@0
|
136 STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
rlm@0
|
137 ENDIF()
|
rlm@0
|
138 ENDFOREACH(flag_var)
|
rlm@0
|
139 ENDIF()
|
rlm@0
|
140 ELSE()
|
rlm@0
|
141 ADD_DEFINITIONS(-Winline -Wall)
|
rlm@0
|
142 CHECK_C_COMPILER_FLAG(-Wextra HAVE_W_EXTRA)
|
rlm@0
|
143 IF(HAVE_W_EXTRA)
|
rlm@0
|
144 ADD_DEFINITIONS(-Wextra)
|
rlm@0
|
145 ENDIF()
|
rlm@0
|
146
|
rlm@0
|
147 IF(WERROR)
|
rlm@0
|
148 ADD_DEFINITIONS(-Werror)
|
rlm@0
|
149 ENDIF()
|
rlm@0
|
150
|
rlm@0
|
151 SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -D_DEBUG" CACHE STRING
|
rlm@0
|
152 "Flags used by the compiler during Release with Debug Info builds."
|
rlm@0
|
153 FORCE)
|
rlm@0
|
154 SET(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG" CACHE STRING
|
rlm@0
|
155 "Flags used by the compiler during release minsize builds."
|
rlm@0
|
156 FORCE)
|
rlm@0
|
157 SET(CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer -DNDEBUG" CACHE STRING
|
rlm@0
|
158 "Flags used by the compiler during release builds"
|
rlm@0
|
159 FORCE)
|
rlm@0
|
160 SET(CMAKE_C_FLAGS_DEBUG "-g3 -D_DEBUG" CACHE STRING
|
rlm@0
|
161 "Flags used by the compiler during debug builds."
|
rlm@0
|
162 FORCE)
|
rlm@0
|
163
|
rlm@0
|
164 CHECK_C_SOURCE_COMPILES("int foo() __attribute__((destructor));
|
rlm@0
|
165 int main() {return 0;}" HAVE_GCC_DESTRUCTOR)
|
rlm@0
|
166 ENDIF()
|
rlm@0
|
167
|
rlm@0
|
168 # Set visibility/export options if available
|
rlm@0
|
169 IF(WIN32)
|
rlm@0
|
170 SET(EXPORT_DECL "__declspec(dllexport)")
|
rlm@0
|
171
|
rlm@0
|
172 OPTION(WINE "Enable use of Wine headers when compiling" OFF)
|
rlm@0
|
173 IF(WINE)
|
rlm@0
|
174 FIND_PATH(WINE_INCLUDE_DIR library.h
|
rlm@0
|
175 PATHS
|
rlm@0
|
176 /usr/include/wine
|
rlm@0
|
177 /usr/local/include/wine
|
rlm@0
|
178 CMAKE_FIND_ROOT_PATH_BOTH)
|
rlm@0
|
179 IF(WINE_INCLUDE_DIR)
|
rlm@0
|
180 MESSAGE(STATUS "Found Wine header files - ${WINE_INCLUDE_DIR}" )
|
rlm@0
|
181 INCLUDE_DIRECTORIES("${WINE_INCLUDE_DIR}/windows")
|
rlm@0
|
182 SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} "${WINE_INCLUDE_DIR}/windows")
|
rlm@0
|
183 ELSE()
|
rlm@0
|
184 MESSAGE(STATUS "Could not find Wine header files" )
|
rlm@0
|
185 ENDIF()
|
rlm@0
|
186 ENDIF()
|
rlm@0
|
187 ELSE()
|
rlm@0
|
188 CHECK_C_COMPILER_FLAG(-fvisibility=internal HAVE_VISIBILITY_SWITCH)
|
rlm@0
|
189 CHECK_C_SOURCE_COMPILES("int foo() __attribute__((visibility(\"protected\")));
|
rlm@0
|
190 int main() {return 0;}" HAVE_GCC_VISIBILITY)
|
rlm@0
|
191 IF(HAVE_VISIBILITY_SWITCH AND HAVE_GCC_VISIBILITY)
|
rlm@0
|
192 #ADD_DEFINITIONS(-fvisibility=internal)
|
rlm@0
|
193 #SET(EXPORT_DECL "__attribute__((visibility(\"protected\")))")
|
rlm@0
|
194 ENDIF()
|
rlm@0
|
195 ENDIF()
|
rlm@0
|
196
|
rlm@0
|
197 CHECK_C_SOURCE_COMPILES("int foo(const char *str, ...) __attribute__((format(printf, 1, 2)));
|
rlm@0
|
198 int main() {return 0;}" HAVE_GCC_FORMAT)
|
rlm@0
|
199
|
rlm@0
|
200 CHECK_INCLUDE_FILE(fenv.h HAVE_FENV_H)
|
rlm@0
|
201 CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
|
rlm@0
|
202 CHECK_INCLUDE_FILE(ieeefp.h HAVE_IEEEFP_H)
|
rlm@0
|
203 CHECK_INCLUDE_FILE(guiddef.h HAVE_GUIDDEF_H)
|
rlm@0
|
204 IF(NOT HAVE_GUIDDEF_H)
|
rlm@0
|
205 CHECK_INCLUDE_FILE(initguid.h HAVE_INITGUID_H)
|
rlm@0
|
206 ENDIF()
|
rlm@0
|
207 CHECK_INCLUDE_FILE(arm_neon.h HAVE_ARM_NEON_H)
|
rlm@0
|
208
|
rlm@0
|
209 CHECK_LIBRARY_EXISTS(m powf "" HAVE_POWF)
|
rlm@0
|
210 CHECK_LIBRARY_EXISTS(m sqrtf "" HAVE_SQRTF)
|
rlm@0
|
211 CHECK_LIBRARY_EXISTS(m acosf "" HAVE_ACOSF)
|
rlm@0
|
212 CHECK_LIBRARY_EXISTS(m atanf "" HAVE_ATANF)
|
rlm@0
|
213 CHECK_LIBRARY_EXISTS(m fabsf "" HAVE_FABSF)
|
rlm@0
|
214 IF(HAVE_FENV_H)
|
rlm@0
|
215 CHECK_LIBRARY_EXISTS(m fesetround "" HAVE_FESETROUND)
|
rlm@0
|
216 ENDIF()
|
rlm@0
|
217 IF(HAVE_SQRTF OR HAVE_ACOSF OR HAVE_ATANF OR HAVE_FABSF OR HAVE_FESETROUND)
|
rlm@0
|
218 SET(EXTRA_LIBS m ${EXTRA_LIBS})
|
rlm@0
|
219 ENDIF()
|
rlm@0
|
220 CHECK_FUNCTION_EXISTS(strtof HAVE_STRTOF)
|
rlm@0
|
221 CHECK_FUNCTION_EXISTS(_controlfp HAVE__CONTROLFP)
|
rlm@0
|
222
|
rlm@0
|
223 CHECK_FUNCTION_EXISTS(stat HAVE_STAT)
|
rlm@0
|
224 CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
|
rlm@0
|
225 IF(NOT HAVE_STRCASECMP)
|
rlm@0
|
226 CHECK_FUNCTION_EXISTS(_stricmp HAVE__STRICMP)
|
rlm@0
|
227 IF(NOT HAVE__STRICMP)
|
rlm@0
|
228 MESSAGE(FATAL_ERROR "No case-insensitive compare function found, please report!")
|
rlm@0
|
229 ENDIF()
|
rlm@0
|
230
|
rlm@0
|
231 ADD_DEFINITIONS(-Dstrcasecmp=_stricmp)
|
rlm@0
|
232 ENDIF()
|
rlm@0
|
233
|
rlm@0
|
234 CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
|
rlm@0
|
235 IF(NOT HAVE_STRNCASECMP)
|
rlm@0
|
236 CHECK_FUNCTION_EXISTS(_strnicmp HAVE__STRNICMP)
|
rlm@0
|
237 IF(NOT HAVE__STRNICMP)
|
rlm@0
|
238 MESSAGE(FATAL_ERROR "No case-insensitive size-limitted compare function found, please report!")
|
rlm@0
|
239 ENDIF()
|
rlm@0
|
240
|
rlm@0
|
241 ADD_DEFINITIONS(-Dstrncasecmp=_strnicmp)
|
rlm@0
|
242 ENDIF()
|
rlm@0
|
243
|
rlm@0
|
244 CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
|
rlm@0
|
245 IF(NOT HAVE_SNPRINTF)
|
rlm@0
|
246 CHECK_FUNCTION_EXISTS(_snprintf HAVE__SNPRINTF)
|
rlm@0
|
247 IF(NOT HAVE__SNPRINTF)
|
rlm@0
|
248 MESSAGE(FATAL_ERROR "No snprintf function found, please report!")
|
rlm@0
|
249 ENDIF()
|
rlm@0
|
250
|
rlm@0
|
251 ADD_DEFINITIONS(-Dsnprintf=_snprintf)
|
rlm@0
|
252 ENDIF()
|
rlm@0
|
253
|
rlm@0
|
254 CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF)
|
rlm@0
|
255 IF(NOT HAVE_VSNPRINTF)
|
rlm@0
|
256 CHECK_FUNCTION_EXISTS(_vsnprintf HAVE__VSNPRINTF)
|
rlm@0
|
257 IF(NOT HAVE__VSNPRINTF)
|
rlm@0
|
258 MESSAGE(FATAL_ERROR "No vsnprintf function found, please report!")
|
rlm@0
|
259 ENDIF()
|
rlm@0
|
260
|
rlm@0
|
261 ADD_DEFINITIONS(-Dvsnprintf=_vsnprintf)
|
rlm@0
|
262 ENDIF()
|
rlm@0
|
263
|
rlm@0
|
264 CHECK_SYMBOL_EXISTS(isfinite math.h HAVE_ISFINITE)
|
rlm@0
|
265 IF(NOT HAVE_ISFINITE)
|
rlm@0
|
266 CHECK_FUNCTION_EXISTS(finite HAVE_FINITE)
|
rlm@0
|
267 IF(NOT HAVE_FINITE)
|
rlm@0
|
268 CHECK_FUNCTION_EXISTS(_finite HAVE__FINITE)
|
rlm@0
|
269 IF(NOT HAVE__FINITE)
|
rlm@0
|
270 MESSAGE(FATAL_ERROR "No isfinite function found, please report!")
|
rlm@0
|
271 ENDIF()
|
rlm@0
|
272 ADD_DEFINITIONS(-Disfinite=_finite)
|
rlm@0
|
273 ELSE()
|
rlm@0
|
274 ADD_DEFINITIONS(-Disfinite=finite)
|
rlm@0
|
275 ENDIF()
|
rlm@0
|
276 ENDIF()
|
rlm@0
|
277
|
rlm@0
|
278 CHECK_SYMBOL_EXISTS(isnan math.h HAVE_ISNAN)
|
rlm@0
|
279 IF(NOT HAVE_ISNAN)
|
rlm@0
|
280 CHECK_FUNCTION_EXISTS(_isnan HAVE__ISNAN)
|
rlm@0
|
281 IF(NOT HAVE__ISNAN)
|
rlm@0
|
282 MESSAGE(FATAL_ERROR "No isnan function found, please report!")
|
rlm@0
|
283 ENDIF()
|
rlm@0
|
284
|
rlm@0
|
285 ADD_DEFINITIONS(-Disnan=_isnan)
|
rlm@0
|
286 ENDIF()
|
rlm@0
|
287
|
rlm@0
|
288
|
rlm@0
|
289 # Check for the dlopen API (for dynamicly loading backend libs)
|
rlm@0
|
290 IF(DLOPEN)
|
rlm@0
|
291 CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
|
rlm@0
|
292 IF(HAVE_DLFCN_H)
|
rlm@0
|
293 CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
|
rlm@0
|
294 IF(HAVE_LIBDL)
|
rlm@0
|
295 SET(EXTRA_LIBS dl ${EXTRA_LIBS})
|
rlm@0
|
296 ENDIF()
|
rlm@0
|
297 ENDIF()
|
rlm@0
|
298 ENDIF()
|
rlm@0
|
299
|
rlm@0
|
300 # Check if we have Windows headers
|
rlm@0
|
301 CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H -D_WIN32_WINNT=0x0500)
|
rlm@0
|
302 IF(NOT HAVE_WINDOWS_H)
|
rlm@0
|
303 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
|
rlm@0
|
304 IF(NOT HAVE_GETTIMEOFDAY)
|
rlm@0
|
305 MESSAGE(FATAL_ERROR "No timing function found!")
|
rlm@0
|
306 ENDIF()
|
rlm@0
|
307
|
rlm@0
|
308 CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
|
rlm@0
|
309 IF(NOT HAVE_NANOSLEEP)
|
rlm@0
|
310 MESSAGE(FATAL_ERROR "No sleep function found!")
|
rlm@0
|
311 ENDIF()
|
rlm@0
|
312
|
rlm@0
|
313 CHECK_C_COMPILER_FLAG(-pthread HAVE_PTHREAD)
|
rlm@0
|
314 IF(HAVE_PTHREAD)
|
rlm@0
|
315 ADD_DEFINITIONS(-pthread)
|
rlm@0
|
316 SET(EXTRA_LIBS ${EXTRA_LIBS} -pthread)
|
rlm@0
|
317 ENDIF()
|
rlm@0
|
318
|
rlm@0
|
319 # We need pthreads outside of Windows
|
rlm@0
|
320 CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
|
rlm@0
|
321 IF(NOT HAVE_PTHREAD_H)
|
rlm@0
|
322 MESSAGE(FATAL_ERROR "PThreads is required for non-Windows builds!")
|
rlm@0
|
323 ENDIF()
|
rlm@0
|
324 # Some systems need pthread_np.h to get recursive mutexes
|
rlm@0
|
325 CHECK_INCLUDE_FILES("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H)
|
rlm@0
|
326
|
rlm@0
|
327 # _GNU_SOURCE is needed on some systems for extra attributes, and
|
rlm@0
|
328 # _REENTRANT is needed for libc thread-safety
|
rlm@0
|
329 ADD_DEFINITIONS(-D_GNU_SOURCE=1)
|
rlm@0
|
330 CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_LIBPTHREAD)
|
rlm@0
|
331 IF(HAVE_LIBPTHREAD)
|
rlm@0
|
332 SET(EXTRA_LIBS pthread ${EXTRA_LIBS})
|
rlm@0
|
333 ENDIF()
|
rlm@0
|
334
|
rlm@0
|
335 CHECK_LIBRARY_EXISTS(pthread pthread_setschedparam "" HAVE_PTHREAD_SETSCHEDPARAM)
|
rlm@0
|
336
|
rlm@0
|
337 CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_LIBRT)
|
rlm@0
|
338 IF(HAVE_LIBRT)
|
rlm@0
|
339 SET(EXTRA_LIBS rt ${EXTRA_LIBS})
|
rlm@0
|
340 ENDIF()
|
rlm@0
|
341 ENDIF()
|
rlm@0
|
342
|
rlm@0
|
343 # Check for a 64-bit type
|
rlm@0
|
344 CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
|
rlm@0
|
345 IF(NOT HAVE_STDINT_H)
|
rlm@0
|
346 IF(HAVE_WINDOWS_H)
|
rlm@0
|
347 CHECK_C_SOURCE_COMPILES("\#define _WIN32_WINNT 0x0500
|
rlm@0
|
348 \#include <windows.h>
|
rlm@0
|
349 __int64 foo;
|
rlm@0
|
350 int main() {return 0;}" HAVE___INT64)
|
rlm@0
|
351 ENDIF()
|
rlm@0
|
352 IF(NOT HAVE___INT64)
|
rlm@0
|
353 IF(NOT SIZEOF_LONG MATCHES "8")
|
rlm@0
|
354 IF(NOT SIZEOF_LONG_LONG MATCHES "8")
|
rlm@0
|
355 MESSAGE(FATAL_ERROR "No 64-bit types found, please report!")
|
rlm@0
|
356 ENDIF()
|
rlm@0
|
357 ENDIF()
|
rlm@0
|
358 ENDIF()
|
rlm@0
|
359 ENDIF()
|
rlm@0
|
360
|
rlm@0
|
361 # Windows needs winmm for timeGetTime, even if the backend is disabled
|
rlm@0
|
362 CHECK_SHARED_FUNCTION_EXISTS(timeGetTime "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
|
rlm@0
|
363 IF(HAVE_LIBWINMM)
|
rlm@0
|
364 SET(EXTRA_LIBS winmm ${EXTRA_LIBS})
|
rlm@0
|
365 SET(PKG_CONFIG_LIBS ${PKG_CONFIG_LIBS} -lwinmm)
|
rlm@0
|
366 ENDIF()
|
rlm@0
|
367
|
rlm@0
|
368
|
rlm@0
|
369 SET(OPENAL_OBJS OpenAL32/alAuxEffectSlot.c
|
rlm@0
|
370 OpenAL32/alBuffer.c
|
rlm@0
|
371 OpenAL32/alEffect.c
|
rlm@0
|
372 OpenAL32/alError.c
|
rlm@0
|
373 OpenAL32/alExtension.c
|
rlm@0
|
374 OpenAL32/alFilter.c
|
rlm@0
|
375 OpenAL32/alListener.c
|
rlm@0
|
376 OpenAL32/alSource.c
|
rlm@0
|
377 OpenAL32/alState.c
|
rlm@0
|
378 OpenAL32/alThunk.c
|
rlm@0
|
379 )
|
rlm@0
|
380 SET(ALC_OBJS Alc/ALc.c
|
rlm@0
|
381 Alc/ALu.c
|
rlm@0
|
382 Alc/alcConfig.c
|
rlm@0
|
383 Alc/alcDedicated.c
|
rlm@0
|
384 Alc/alcEcho.c
|
rlm@0
|
385 Alc/alcModulator.c
|
rlm@0
|
386 Alc/alcReverb.c
|
rlm@0
|
387 Alc/alcRing.c
|
rlm@0
|
388 Alc/alcThread.c
|
rlm@0
|
389 Alc/bs2b.c
|
rlm@0
|
390 Alc/helpers.c
|
rlm@0
|
391 Alc/hrtf.c
|
rlm@0
|
392 Alc/mixer.c
|
rlm@0
|
393 Alc/panning.c
|
rlm@0
|
394 # Default backends, always available
|
rlm@0
|
395 Alc/backends/loopback.c
|
rlm@0
|
396 Alc/backends/null.c
|
rlm@0
|
397 # RLM: add send device
|
rlm@0
|
398 Alc/backends/send.c
|
rlm@0
|
399 )
|
rlm@0
|
400
|
rlm@0
|
401 SET(BACKENDS "")
|
rlm@0
|
402 SET(HAVE_ALSA 0)
|
rlm@0
|
403 SET(HAVE_OSS 0)
|
rlm@0
|
404 SET(HAVE_SOLARIS 0)
|
rlm@0
|
405 SET(HAVE_SNDIO 0)
|
rlm@0
|
406 SET(HAVE_DSOUND 0)
|
rlm@0
|
407 SET(HAVE_WINMM 0)
|
rlm@0
|
408 SET(HAVE_PORTAUDIO 0)
|
rlm@0
|
409 SET(HAVE_PULSEAUDIO 0)
|
rlm@0
|
410 SET(HAVE_COREAUDIO 0)
|
rlm@0
|
411 SET(HAVE_OPENSL 0)
|
rlm@0
|
412 SET(HAVE_WAVE 0)
|
rlm@0
|
413
|
rlm@0
|
414
|
rlm@0
|
415 # Check ALSA backend
|
rlm@0
|
416 IF(ALSA)
|
rlm@0
|
417 CHECK_INCLUDE_FILE(alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H)
|
rlm@0
|
418 IF(HAVE_ALSA_ASOUNDLIB_H)
|
rlm@0
|
419 CHECK_SHARED_FUNCTION_EXISTS(snd_pcm_open "alsa/asoundlib.h" asound "" HAVE_LIBASOUND)
|
rlm@0
|
420 IF(HAVE_LIBASOUND OR HAVE_DLFCN_H OR WIN32)
|
rlm@0
|
421 SET(HAVE_ALSA 1)
|
rlm@0
|
422 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/alsa.c)
|
rlm@0
|
423 IF(HAVE_DLFCN_H OR WIN32)
|
rlm@0
|
424 SET(BACKENDS "${BACKENDS} ALSA,")
|
rlm@0
|
425 ELSE()
|
rlm@0
|
426 SET(BACKENDS "${BACKENDS} ALSA \(linked\),")
|
rlm@0
|
427 SET(EXTRA_LIBS asound ${EXTRA_LIBS})
|
rlm@0
|
428 ENDIF()
|
rlm@0
|
429 ENDIF()
|
rlm@0
|
430 ENDIF()
|
rlm@0
|
431 ENDIF()
|
rlm@0
|
432 IF(REQUIRE_ALSA AND NOT HAVE_ALSA)
|
rlm@0
|
433 MESSAGE(FATAL_ERROR "Failed to enabled required ALSA backend")
|
rlm@0
|
434 ENDIF()
|
rlm@0
|
435
|
rlm@0
|
436 # Check OSS backend
|
rlm@0
|
437 IF(OSS)
|
rlm@0
|
438 CHECK_INCLUDE_FILE(sys/soundcard.h HAVE_SYS_SOUNDCARD_H)
|
rlm@0
|
439 IF(HAVE_SYS_SOUNDCARD_H)
|
rlm@0
|
440 SET(HAVE_OSS 1)
|
rlm@0
|
441 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/oss.c)
|
rlm@0
|
442 SET(BACKENDS "${BACKENDS} OSS,")
|
rlm@0
|
443 ENDIF()
|
rlm@0
|
444 ENDIF()
|
rlm@0
|
445 IF(REQUIRE_OSS AND NOT HAVE_OSS)
|
rlm@0
|
446 MESSAGE(FATAL_ERROR "Failed to enabled required OSS backend")
|
rlm@0
|
447 ENDIF()
|
rlm@0
|
448
|
rlm@0
|
449 # Check Solaris backend
|
rlm@0
|
450 IF(SOLARIS)
|
rlm@0
|
451 CHECK_INCLUDE_FILE(sys/audioio.h HAVE_SYS_AUDIOIO_H)
|
rlm@0
|
452 IF(HAVE_SYS_AUDIOIO_H)
|
rlm@0
|
453 SET(HAVE_SOLARIS 1)
|
rlm@0
|
454 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/solaris.c)
|
rlm@0
|
455 SET(BACKENDS "${BACKENDS} Solaris,")
|
rlm@0
|
456 ENDIF()
|
rlm@0
|
457 ENDIF()
|
rlm@0
|
458 IF(REQUIRE_SOLARIS AND NOT HAVE_SOLARIS)
|
rlm@0
|
459 MESSAGE(FATAL_ERROR "Failed to enabled required Solaris backend")
|
rlm@0
|
460 ENDIF()
|
rlm@0
|
461
|
rlm@0
|
462 # Check SndIO backend
|
rlm@0
|
463 IF(SNDIO)
|
rlm@0
|
464 CHECK_INCLUDE_FILE(sndio.h HAVE_SNDIO_H)
|
rlm@0
|
465 IF(HAVE_SNDIO_H)
|
rlm@0
|
466 CHECK_SHARED_FUNCTION_EXISTS(sio_open "sndio.h" sndio "" HAVE_LIBSNDIO)
|
rlm@0
|
467 IF(HAVE_LIBSNDIO OR HAVE_DLFCN_H OR WIN32)
|
rlm@0
|
468 SET(HAVE_SNDIO 1)
|
rlm@0
|
469 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/sndio.c)
|
rlm@0
|
470 IF(HAVE_DLFCN_H OR WIN32)
|
rlm@0
|
471 SET(BACKENDS "${BACKENDS} SndIO,")
|
rlm@0
|
472 ELSE()
|
rlm@0
|
473 SET(BACKENDS "${BACKENDS} SndIO \(linked\),")
|
rlm@0
|
474 SET(EXTRA_LIBS sndio ${EXTRA_LIBS})
|
rlm@0
|
475 ENDIF()
|
rlm@0
|
476 ENDIF()
|
rlm@0
|
477 ENDIF()
|
rlm@0
|
478 ENDIF()
|
rlm@0
|
479 IF(REQUIRE_SNDIO AND NOT HAVE_SNDIO)
|
rlm@0
|
480 MESSAGE(FATAL_ERROR "Failed to enabled required SndIO backend")
|
rlm@0
|
481 ENDIF()
|
rlm@0
|
482
|
rlm@0
|
483 # Check for MMDevApi backend
|
rlm@0
|
484 IF(HAVE_WINDOWS_H)
|
rlm@0
|
485 IF(MMDEVAPI)
|
rlm@0
|
486 CHECK_INCLUDE_FILE(mmdeviceapi.h HAVE_MMDEVICEAPI_H)
|
rlm@0
|
487 IF(HAVE_MMDEVICEAPI_H)
|
rlm@0
|
488 SET(HAVE_MMDEVAPI 1)
|
rlm@0
|
489 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/mmdevapi.c)
|
rlm@0
|
490
|
rlm@0
|
491 SET(BACKENDS "${BACKENDS} MMDevApi,")
|
rlm@0
|
492 ENDIF()
|
rlm@0
|
493 ENDIF()
|
rlm@0
|
494 ENDIF()
|
rlm@0
|
495 IF(REQUIRE_MMDEVAPI AND NOT HAVE_MMDEVAPI)
|
rlm@0
|
496 MESSAGE(FATAL_ERROR "Failed to enabled required MMDevApi backend")
|
rlm@0
|
497 ENDIF()
|
rlm@0
|
498
|
rlm@0
|
499 # Check DSound/MMSystem backend
|
rlm@0
|
500 IF(DSOUND)
|
rlm@0
|
501 CHECK_INCLUDE_FILE(dsound.h HAVE_DSOUND_H)
|
rlm@0
|
502 IF(HAVE_DSOUND_H)
|
rlm@0
|
503 CHECK_SHARED_FUNCTION_EXISTS(DirectSoundCreate "dsound.h" dsound "" HAVE_LIBDSOUND)
|
rlm@0
|
504 IF(HAVE_LIBDSOUND OR HAVE_DLFCN_H OR WIN32)
|
rlm@0
|
505 SET(HAVE_DSOUND 1)
|
rlm@0
|
506 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/dsound.c)
|
rlm@0
|
507
|
rlm@0
|
508 IF(HAVE_DLFCN_H OR WIN32)
|
rlm@0
|
509 SET(BACKENDS "${BACKENDS} DirectSound,")
|
rlm@0
|
510 ELSE()
|
rlm@0
|
511 SET(BACKENDS "${BACKENDS} DirectSound \(linked\),")
|
rlm@0
|
512 SET(EXTRA_LIBS dsound ${EXTRA_LIBS})
|
rlm@0
|
513 ENDIF()
|
rlm@0
|
514 ENDIF()
|
rlm@0
|
515 ENDIF()
|
rlm@0
|
516 ENDIF()
|
rlm@0
|
517 IF(REQUIRE_DSOUND AND NOT HAVE_DSOUND)
|
rlm@0
|
518 MESSAGE(FATAL_ERROR "Failed to enabled required DSound backend")
|
rlm@0
|
519 ENDIF()
|
rlm@0
|
520
|
rlm@0
|
521 IF(HAVE_WINDOWS_H)
|
rlm@0
|
522 IF(WINMM)
|
rlm@0
|
523 CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0500)
|
rlm@0
|
524 IF(HAVE_MMSYSTEM_H AND HAVE_LIBWINMM)
|
rlm@0
|
525 SET(HAVE_WINMM 1)
|
rlm@0
|
526 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/winmm.c)
|
rlm@0
|
527 SET(BACKENDS "${BACKENDS} WinMM,")
|
rlm@0
|
528 ENDIF()
|
rlm@0
|
529 ENDIF()
|
rlm@0
|
530 ENDIF()
|
rlm@0
|
531 IF(REQUIRE_WINMM AND NOT HAVE_WINMM)
|
rlm@0
|
532 MESSAGE(FATAL_ERROR "Failed to enable required WinMM backend")
|
rlm@0
|
533 ENDIF()
|
rlm@0
|
534
|
rlm@0
|
535 # Check PortAudio backend
|
rlm@0
|
536 IF(PORTAUDIO)
|
rlm@0
|
537 CHECK_INCLUDE_FILE(portaudio.h HAVE_PORTAUDIO_H)
|
rlm@0
|
538 IF(HAVE_PORTAUDIO_H)
|
rlm@0
|
539 CHECK_SHARED_FUNCTION_EXISTS(Pa_Initialize "portaudio.h" portaudio "" HAVE_LIBPORTAUDIO)
|
rlm@0
|
540 IF(HAVE_LIBPORTAUDIO OR HAVE_DLFCN_H OR WIN32)
|
rlm@0
|
541 SET(HAVE_PORTAUDIO 1)
|
rlm@0
|
542 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/portaudio.c)
|
rlm@0
|
543 IF(HAVE_DLFCN_H OR WIN32)
|
rlm@0
|
544 SET(BACKENDS "${BACKENDS} PortAudio,")
|
rlm@0
|
545 ELSE()
|
rlm@0
|
546 SET(BACKENDS "${BACKENDS} PortAudio \(linked\),")
|
rlm@0
|
547 SET(EXTRA_LIBS portaudio ${EXTRA_LIBS})
|
rlm@0
|
548 ENDIF()
|
rlm@0
|
549 ENDIF()
|
rlm@0
|
550 ENDIF()
|
rlm@0
|
551 ENDIF()
|
rlm@0
|
552 IF(REQUIRE_PORTAUDIO AND NOT HAVE_PORTAUDIO)
|
rlm@0
|
553 MESSAGE(FATAL_ERROR "Failed to enabled required PortAudio backend")
|
rlm@0
|
554 ENDIF()
|
rlm@0
|
555
|
rlm@0
|
556 # Check PulseAudio backend
|
rlm@0
|
557 IF(PULSEAUDIO)
|
rlm@0
|
558 CHECK_INCLUDE_FILE(pulse/pulseaudio.h HAVE_PULSE_PULSEAUDIO_H)
|
rlm@0
|
559 IF(HAVE_PULSE_PULSEAUDIO_H)
|
rlm@0
|
560 CHECK_SHARED_FUNCTION_EXISTS(pa_context_new "pulse/pulseaudio.h" pulse "" HAVE_LIBPULSE)
|
rlm@0
|
561 IF(HAVE_LIBPULSE OR HAVE_DLFCN_H OR WIN32)
|
rlm@0
|
562 SET(HAVE_PULSEAUDIO 1)
|
rlm@0
|
563 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/pulseaudio.c)
|
rlm@0
|
564 IF(HAVE_DLFCN_H OR WIN32)
|
rlm@0
|
565 SET(BACKENDS "${BACKENDS} PulseAudio,")
|
rlm@0
|
566 ELSE()
|
rlm@0
|
567 SET(BACKENDS "${BACKENDS} PulseAudio \(linked\),")
|
rlm@0
|
568 SET(EXTRA_LIBS pulse ${EXTRA_LIBS})
|
rlm@0
|
569 ENDIF()
|
rlm@0
|
570 ENDIF()
|
rlm@0
|
571 ENDIF()
|
rlm@0
|
572 ENDIF()
|
rlm@0
|
573 IF(REQUIRE_PULSEAUDIO AND NOT HAVE_PULSEAUDIO)
|
rlm@0
|
574 MESSAGE(FATAL_ERROR "Failed to enabled required PulseAudio backend")
|
rlm@0
|
575 ENDIF()
|
rlm@0
|
576
|
rlm@0
|
577 # Check CoreAudio backend
|
rlm@0
|
578 IF(COREAUDIO)
|
rlm@0
|
579 CHECK_INCLUDE_FILE(/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudio.h HAVE_COREAUDIO_FRAMEWORK)
|
rlm@0
|
580 IF(HAVE_COREAUDIO_FRAMEWORK)
|
rlm@0
|
581 SET(HAVE_COREAUDIO 1)
|
rlm@0
|
582 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/coreaudio.c)
|
rlm@0
|
583 SET(BACKENDS "${BACKENDS} CoreAudio,")
|
rlm@0
|
584 SET(EXTRA_LIBS /System/Library/Frameworks/CoreAudio.framework ${EXTRA_LIBS})
|
rlm@0
|
585 SET(EXTRA_LIBS /System/Library/Frameworks/AudioUnit.framework ${EXTRA_LIBS})
|
rlm@0
|
586 SET(EXTRA_LIBS /System/Library/Frameworks/ApplicationServices.framework ${EXTRA_LIBS})
|
rlm@0
|
587 ENDIF()
|
rlm@0
|
588 ENDIF()
|
rlm@0
|
589 IF(REQUIRE_COREAUDIO AND NOT HAVE_COREAUDIO)
|
rlm@0
|
590 MESSAGE(FATAL_ERROR "Failed to enabled required CoreAudio backend")
|
rlm@0
|
591 ENDIF()
|
rlm@0
|
592
|
rlm@0
|
593 # Check for OpenSL (Android) backend
|
rlm@0
|
594 IF(OPENSL)
|
rlm@0
|
595 CHECK_INCLUDE_FILE(SLES/OpenSLES_Android.h HAVE_SLES_OPENSLES_ANDROID_H)
|
rlm@0
|
596 IF(HAVE_SLES_OPENSLES_ANDROID_H)
|
rlm@0
|
597 CHECK_SHARED_FUNCTION_EXISTS(slCreateEngine "SLES/OpenSLES.h" OpenSLES "" HAVE_LIBOPENSLES)
|
rlm@0
|
598 IF(HAVE_LIBOPENSLES)
|
rlm@0
|
599 SET(HAVE_OPENSL 1)
|
rlm@0
|
600 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/opensl.c)
|
rlm@0
|
601 SET(BACKENDS "${BACKENDS} OpenSL,")
|
rlm@0
|
602 SET(EXTRA_LIBS OpenSLES ${EXTRA_LIBS})
|
rlm@0
|
603 ENDIF()
|
rlm@0
|
604 ENDIF()
|
rlm@0
|
605 ENDIF()
|
rlm@0
|
606 IF(REQUIRE_OPENSL AND NOT HAVE_OPENSL)
|
rlm@0
|
607 MESSAGE(FATAL_ERROR "Failed to enable required OpenSL backend")
|
rlm@0
|
608 ENDIF()
|
rlm@0
|
609
|
rlm@0
|
610 # Optionally enable the Wave Writer backend
|
rlm@0
|
611 IF(WAVE)
|
rlm@0
|
612 SET(HAVE_WAVE 1)
|
rlm@0
|
613 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/wave.c)
|
rlm@0
|
614 SET(BACKENDS "${BACKENDS} WaveFile,")
|
rlm@0
|
615 ENDIF()
|
rlm@0
|
616
|
rlm@0
|
617
|
rlm@0
|
618 SET(ALC_OBJS ${ALC_OBJS} Alc/backends/send.c)
|
rlm@0
|
619 SET(BACKENDS "${BACKENDS} Send,")
|
rlm@0
|
620
|
rlm@0
|
621
|
rlm@0
|
622 # This is always available
|
rlm@0
|
623 SET(BACKENDS "${BACKENDS} Null")
|
rlm@0
|
624
|
rlm@0
|
625 IF(LIBTYPE STREQUAL "STATIC")
|
rlm@0
|
626 ADD_DEFINITIONS(-DAL_LIBTYPE_STATIC)
|
rlm@0
|
627 SET(PKG_CONFIG_CFLAGS -DAL_LIBTYPE_STATIC ${PKG_CONFIG_CFLAGS})
|
rlm@0
|
628 ENDIF()
|
rlm@0
|
629
|
rlm@0
|
630 # Needed for openal.pc.in
|
rlm@0
|
631 SET(prefix ${CMAKE_INSTALL_PREFIX})
|
rlm@0
|
632 SET(exec_prefix "\${prefix}")
|
rlm@0
|
633 SET(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
|
rlm@0
|
634 SET(bindir "\${exec_prefix}/bin")
|
rlm@0
|
635 SET(includedir "\${prefix}/include")
|
rlm@0
|
636 SET(PACKAGE_VERSION "${LIB_VERSION}")
|
rlm@0
|
637
|
rlm@0
|
638 # End configuration
|
rlm@0
|
639 CONFIGURE_FILE(
|
rlm@0
|
640 "${OpenAL_SOURCE_DIR}/config.h.in"
|
rlm@0
|
641 "${OpenAL_BINARY_DIR}/config.h")
|
rlm@0
|
642 CONFIGURE_FILE(
|
rlm@0
|
643 "${OpenAL_SOURCE_DIR}/openal.pc.in"
|
rlm@0
|
644 "${OpenAL_BINARY_DIR}/openal.pc"
|
rlm@0
|
645 @ONLY)
|
rlm@0
|
646
|
rlm@0
|
647 # Build a library
|
rlm@0
|
648 ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${OPENAL_OBJS} ${ALC_OBJS})
|
rlm@0
|
649 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES DEFINE_SYMBOL AL_BUILD_LIBRARY
|
rlm@0
|
650 COMPILE_FLAGS -DAL_ALEXT_PROTOTYPES
|
rlm@0
|
651 VERSION ${LIB_VERSION}.0
|
rlm@0
|
652 SOVERSION ${LIB_MAJOR_VERSION})
|
rlm@0
|
653 IF(WIN32 AND NOT LIBTYPE STREQUAL "STATIC")
|
rlm@0
|
654 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES PREFIX "")
|
rlm@0
|
655 ENDIF()
|
rlm@0
|
656
|
rlm@0
|
657 # RLM link jni the dumb way for now:
|
rlm@0
|
658
|
rlm@0
|
659 INCLUDE_DIRECTORIES("/opt/jdk/include/")
|
rlm@0
|
660 INCLUDE_DIRECTORIES("/opt/jdk/include/linux")
|
rlm@0
|
661 TARGET_LINK_LIBRARIES(${LIBNAME} ${EXTRA_LIBS})
|
rlm@0
|
662
|
rlm@0
|
663 # Add an install target here
|
rlm@0
|
664 INSTALL(TARGETS ${LIBNAME}
|
rlm@0
|
665 RUNTIME DESTINATION bin
|
rlm@0
|
666 LIBRARY DESTINATION "lib${LIB_SUFFIX}"
|
rlm@0
|
667 ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
|
rlm@0
|
668 )
|
rlm@0
|
669 INSTALL(FILES include/AL/al.h
|
rlm@0
|
670 include/AL/alc.h
|
rlm@0
|
671 include/AL/alext.h
|
rlm@0
|
672 include/AL/efx.h
|
rlm@0
|
673 include/AL/efx-creative.h
|
rlm@0
|
674 DESTINATION include/AL
|
rlm@0
|
675 )
|
rlm@0
|
676 INSTALL(FILES "${OpenAL_BINARY_DIR}/openal.pc"
|
rlm@0
|
677 DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
|
rlm@0
|
678
|
rlm@0
|
679
|
rlm@0
|
680 MESSAGE(STATUS "")
|
rlm@0
|
681 MESSAGE(STATUS "Building OpenAL with support for the following backends:")
|
rlm@0
|
682 MESSAGE(STATUS " ${BACKENDS}")
|
rlm@0
|
683 MESSAGE(STATUS "")
|
rlm@0
|
684
|
rlm@0
|
685 IF(WIN32)
|
rlm@0
|
686 IF(NOT HAVE_DSOUND)
|
rlm@0
|
687 MESSAGE(STATUS "WARNING: Building the Windows version without DirectSound output")
|
rlm@0
|
688 MESSAGE(STATUS " This is probably NOT what you want!")
|
rlm@0
|
689 MESSAGE(STATUS "")
|
rlm@0
|
690 ENDIF()
|
rlm@0
|
691 ENDIF()
|
rlm@0
|
692
|
rlm@0
|
693 # Install alsoft.conf configuration file
|
rlm@0
|
694 IF(ALSOFT_CONFIG)
|
rlm@0
|
695 INSTALL(FILES alsoftrc.sample
|
rlm@0
|
696 DESTINATION /etc/openal
|
rlm@0
|
697 RENAME alsoft.conf
|
rlm@0
|
698 )
|
rlm@0
|
699 MESSAGE(STATUS "Installing sample alsoft.conf")
|
rlm@0
|
700 MESSAGE(STATUS "")
|
rlm@0
|
701 ENDIF()
|
rlm@0
|
702
|
rlm@0
|
703 IF(UTILS)
|
rlm@0
|
704 ADD_EXECUTABLE(openal-info utils/openal-info.c)
|
rlm@0
|
705 TARGET_LINK_LIBRARIES(openal-info ${LIBNAME})
|
rlm@0
|
706 INSTALL(TARGETS openal-info
|
rlm@0
|
707 RUNTIME DESTINATION bin
|
rlm@0
|
708 LIBRARY DESTINATION "lib${LIB_SUFFIX}"
|
rlm@0
|
709 ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
|
rlm@0
|
710 )
|
rlm@0
|
711 MESSAGE(STATUS "Building utility programs")
|
rlm@0
|
712 MESSAGE(STATUS "")
|
rlm@0
|
713 ENDIF()
|
rlm@0
|
714
|
rlm@0
|
715
|