Use memcpy to copy a string instead of sprintf
[openal-soft.git] / CMakeLists.txt
blob0842aae720460a290bf9e1712badb223b291f958
1 # CMake build file list for OpenAL
3 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
5 IF(COMMAND CMAKE_POLICY)
6   CMAKE_POLICY(SET CMP0003 NEW)
7 ENDIF(COMMAND CMAKE_POLICY)
9 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
11 INCLUDE(CheckFunctionExists)
12 INCLUDE(CheckLibraryExists)
13 INCLUDE(CheckSharedLibraryExists)
14 INCLUDE(CheckIncludeFile)
15 INCLUDE(CheckIncludeFiles)
16 INCLUDE(CheckSymbolExists)
17 INCLUDE(CheckCCompilerFlag)
18 INCLUDE(CheckCSourceCompiles)
19 INCLUDE(CheckTypeSize)
22 PROJECT(OpenAL C)
25 SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
28 OPTION(ALSA    "Check for ALSA backend"                ON)
29 OPTION(OSS     "Check for OSS backend"                 ON)
30 OPTION(SOLARIS "Check for Solaris backend"             ON)
31 OPTION(DSOUND  "Check for DirectSound backend"         ON)
32 OPTION(WINMM   "Check for Windows Multimedia backend"  ON)
33 OPTION(PORTAUDIO  "Check for PortAudio backend"        ON)
34 OPTION(PULSEAUDIO "Check for PulseAudio backend"       ON)
35 OPTION(WAVE    "Enable Wave Writer backend"            ON)
37 OPTION(DLOPEN  "Check for the dlopen API for loading optional libs"  ON)
39 OPTION(WERROR  "Treat compile warnings as errors"      OFF)
41 OPTION(UTILS  "Build and install utility programs"  ON)
43 OPTION(ALSOFT_CONFIG "Install alsoft.conf configuration file" OFF)
46 IF(WIN32)
47     SET(LIBNAME OpenAL32)
48     ADD_DEFINITIONS("-D_WIN32")
49 ELSE()
50     SET(LIBNAME openal)
51 ENDIF()
53 IF(NOT LIBTYPE)
54     SET(LIBTYPE SHARED)
55 ENDIF()
57 SET(LIB_MAJOR_VERSION "1")
58 SET(LIB_MINOR_VERSION "12")
59 SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}")
62 CHECK_TYPE_SIZE("long" SIZEOF_LONG)
63 CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
64 CHECK_TYPE_SIZE("unsigned int" SIZEOF_UINT)
65 CHECK_TYPE_SIZE("void*" SIZEOF_VOIDP)
68 # Add definitions, compiler switches, etc.
69 INCLUDE_DIRECTORIES(OpenAL32/Include include "${OpenAL_BINARY_DIR}")
71 IF(NOT CMAKE_BUILD_TYPE)
72     SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
73         "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
74         FORCE)
75 ENDIF()
76 IF(NOT CMAKE_DEBUG_POSTFIX)
77     SET(CMAKE_DEBUG_POSTFIX "" CACHE STRING
78         "Library postfix for debug builds. Normally left blank."
79         FORCE)
80 ENDIF()
82 IF(MSVC)
83     # ???
84     SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -D_DEBUG")
85     SET(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DNDEBUG")
86     SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG")
87     SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
88     ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
89     ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE)
91     IF(NOT DXSDK_DIR)
92         STRING(REGEX REPLACE "\\\\" "/" DXSDK_DIR "$ENV{DXSDK_DIR}")
93     ELSE()
94         STRING(REGEX REPLACE "\\\\" "/" DXSDK_DIR "${DXSDK_DIR}")
95     ENDIF()
96     IF(DXSDK_DIR)
97         MESSAGE(STATUS "Using DirectX SDK directory: ${DXSDK_DIR}")
98         SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} "${DXSDK_DIR}/Include")
99         INCLUDE_DIRECTORIES("${DXSDK_DIR}/Include")
100         LINK_DIRECTORIES("${DXSDK_DIR}/Lib")
101     ENDIF()
102 ELSE()
103     ADD_DEFINITIONS(-Winline -Wall)
104     CHECK_C_COMPILER_FLAG(-Wextra HAVE_W_EXTRA)
105     IF(HAVE_W_EXTRA)
106         ADD_DEFINITIONS(-Wextra)
107     ENDIF()
109     IF(WERROR)
110         ADD_DEFINITIONS(-Werror)
111     ENDIF()
113     SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -D_DEBUG" CACHE STRING
114         "Flags used by the compiler during Release with Debug Info builds."
115         FORCE)
116     SET(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG" CACHE STRING
117         "Flags used by the compiler during release minsize builds."
118         FORCE)
119     SET(CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer -DNDEBUG" CACHE STRING
120         "Flags used by the compiler during release builds"
121         FORCE)
122     SET(CMAKE_C_FLAGS_DEBUG "-g3 -D_DEBUG" CACHE STRING
123         "Flags used by the compiler during debug builds."
124         FORCE)
126     CHECK_C_SOURCE_COMPILES("int foo() __attribute__((destructor));
127                              int main() {return 0;}" HAVE_GCC_DESTRUCTOR)
129     # Set visibility options if available
130     IF(NOT WIN32)
131         CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY_SWITCH)
132         IF(HAVE_VISIBILITY_SWITCH)
133             CHECK_C_SOURCE_COMPILES("int foo() __attribute__((visibility(\"default\")));
134                                      int main() {return 0;}" HAVE_GCC_VISIBILITY)
135             IF(HAVE_GCC_VISIBILITY)
136                 ADD_DEFINITIONS(-fvisibility=hidden -DHAVE_GCC_VISIBILITY)
137             ENDIF()
138         ENDIF()
139     ENDIF()
140 ENDIF()
142 CHECK_C_SOURCE_COMPILES("int foo(const char *str, ...) __attribute__((format(printf, 1, 2)));
143                          int main() {return 0;}" HAVE_GCC_FORMAT)
145 CHECK_INCLUDE_FILE(fenv.h HAVE_FENV_H)
146 CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
148 CHECK_LIBRARY_EXISTS(m  powf   "" HAVE_POWF)
149 CHECK_LIBRARY_EXISTS(m  sqrtf  "" HAVE_SQRTF)
150 CHECK_LIBRARY_EXISTS(m  acosf  "" HAVE_ACOSF)
151 CHECK_LIBRARY_EXISTS(m  atanf  "" HAVE_ATANF)
152 CHECK_LIBRARY_EXISTS(m  fabsf  "" HAVE_FABSF)
153 IF(HAVE_FENV_H)
154     CHECK_LIBRARY_EXISTS(m  fesetround  "" HAVE_FESETROUND)
155 ENDIF()
156 IF(HAVE_SQRTF OR HAVE_ACOSF OR HAVE_ATANF OR HAVE_FABSF OR HAVE_FESETROUND)
157     SET(EXTRA_LIBS m ${EXTRA_LIBS})
158 ENDIF()
159 CHECK_FUNCTION_EXISTS(strtof HAVE_STRTOF)
160 CHECK_FUNCTION_EXISTS(_controlfp HAVE__CONTROLFP)
162 CHECK_FUNCTION_EXISTS(stat HAVE_STAT)
163 CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
164 IF(NOT HAVE_STRCASECMP)
165     CHECK_FUNCTION_EXISTS(_stricmp HAVE__STRICMP)
166     IF(NOT HAVE__STRICMP)
167         MESSAGE(FATAL_ERROR "No case-insensitive compare function found, please report!")
168     ENDIF()
170     ADD_DEFINITIONS(-Dstrcasecmp=_stricmp)
171 ENDIF()
173 CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
174 IF(NOT HAVE_STRNCASECMP)
175     CHECK_FUNCTION_EXISTS(_strnicmp HAVE__STRNICMP)
176     IF(NOT HAVE__STRNICMP)
177         MESSAGE(FATAL_ERROR "No case-insensitive size-limitted compare function found, please report!")
178     ENDIF()
180     ADD_DEFINITIONS(-Dstrncasecmp=_strnicmp)
181 ENDIF()
183 CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
184 IF(NOT HAVE_SNPRINTF)
185     CHECK_FUNCTION_EXISTS(_snprintf HAVE__SNPRINTF)
186     IF(NOT HAVE__SNPRINTF)
187         MESSAGE(FATAL_ERROR "No snprintf function found, please report!")
188     ENDIF()
190     ADD_DEFINITIONS(-Dsnprintf=_snprintf)
191 ENDIF()
193 CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF)
194 IF(NOT HAVE_VSNPRINTF)
195     CHECK_FUNCTION_EXISTS(_vsnprintf HAVE__VSNPRINTF)
196     IF(NOT HAVE__VSNPRINTF)
197         MESSAGE(FATAL_ERROR "No vsnprintf function found, please report!")
198     ENDIF()
200     ADD_DEFINITIONS(-Dvsnprintf=_vsnprintf)
201 ENDIF()
203 CHECK_SYMBOL_EXISTS(isnan math.h HAVE_ISNAN)
204 IF(NOT HAVE_ISNAN)
205     CHECK_FUNCTION_EXISTS(_isnan HAVE__ISNAN)
206     IF(NOT HAVE__ISNAN)
207         MESSAGE(FATAL_ERROR "No isnan function found, please report!")
208     ENDIF()
210     ADD_DEFINITIONS(-Disnan=_isnan)
211 ENDIF()
214 # Check for the dlopen API (for dynamicly loading backend libs)
215 IF(DLOPEN)
216     CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
217     IF(HAVE_DLFCN_H)
218         CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
219         IF(HAVE_LIBDL)
220             SET(EXTRA_LIBS dl ${EXTRA_LIBS})
221         ENDIF()
222     ENDIF()
223 ENDIF()
225 # Check if we have Windows headers
226 CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H -D_WIN32_WINNT=0x0500)
227 IF(NOT HAVE_WINDOWS_H)
228     CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
229     IF(NOT HAVE_GETTIMEOFDAY)
230         MESSAGE(FATAL_ERROR "No timing function found!")
231     ENDIF()
233     CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
234     IF(NOT HAVE_NANOSLEEP)
235         MESSAGE(FATAL_ERROR "No sleep function found!")
236     ENDIF()
238     CHECK_C_COMPILER_FLAG(-pthread HAVE_PTHREAD)
239     IF(HAVE_PTHREAD)
240         ADD_DEFINITIONS(-pthread)
241         SET(EXTRA_LIBS ${EXTRA_LIBS} -pthread)
242     ENDIF()
244     # We need pthreads outside of Windows
245     CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
246     IF(NOT HAVE_PTHREAD_H)
247         MESSAGE(FATAL_ERROR "PThreads is required for non-Windows builds!")
248     ENDIF()
249     # Some systems need pthread_np.h to get recursive mutexes
250     CHECK_INCLUDE_FILES("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H)
252     # _GNU_SOURCE is needed on some systems for extra attributes, and
253     # _REENTRANT is needed for libc thread-safety
254     ADD_DEFINITIONS(-D_GNU_SOURCE=1)
255     CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_LIBPTHREAD)
256     IF(HAVE_LIBPTHREAD)
257         SET(EXTRA_LIBS pthread ${EXTRA_LIBS})
258     ENDIF()
260     CHECK_LIBRARY_EXISTS(pthread pthread_setschedparam "" HAVE_PTHREAD_SETSCHEDPARAM)
262     CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_LIBRT)
263     IF(HAVE_LIBRT)
264         SET(EXTRA_LIBS rt ${EXTRA_LIBS})
265     ENDIF()
266 ENDIF()
268 # Check for a 64-bit type
269 CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
270 IF(NOT HAVE_STDINT_H)
271     IF(HAVE_WINDOWS_H)
272         CHECK_C_SOURCE_COMPILES("\#define _WIN32_WINNT 0x0500
273                                  \#include <windows.h>
274                                  __int64 foo;
275                                  int main() {return 0;}" HAVE___INT64)
276     ENDIF()
277     IF(NOT HAVE___INT64)
278         IF(NOT SIZEOF_LONG MATCHES "8")
279             IF(NOT SIZEOF_LONG_LONG MATCHES "8")
280                 MESSAGE(FATAL_ERROR "No 64-bit types found, please report!")
281             ENDIF()
282         ENDIF()
283     ENDIF()
284 ENDIF()
286 IF(WIN32)
287     # Windows needs winmm for timeGetTime, even if the backend is disabled
288     CHECK_SHARED_LIBRARY_EXISTS(winmm timeGetTime 0 "" HAVE_LIBWINMM)
289     IF(HAVE_LIBWINMM)
290         SET(EXTRA_LIBS winmm ${EXTRA_LIBS})
291         SET(PKG_CONFIG_LIBS ${PKG_CONFIG_LIBS} -lwinmm)
292     ENDIF()
293 ENDIF()
296 SET(OPENAL_OBJS  OpenAL32/alAuxEffectSlot.c
297                  OpenAL32/alBuffer.c
298                  OpenAL32/alDatabuffer.c
299                  OpenAL32/alEffect.c
300                  OpenAL32/alError.c
301                  OpenAL32/alExtension.c
302                  OpenAL32/alFilter.c
303                  OpenAL32/alListener.c
304                  OpenAL32/alSource.c
305                  OpenAL32/alState.c
306                  OpenAL32/alThunk.c
308 SET(ALC_OBJS  Alc/ALc.c
309               Alc/ALu.c
310               Alc/alcConfig.c
311               Alc/alcEcho.c
312               Alc/alcModulator.c
313               Alc/alcReverb.c
314               Alc/alcRing.c
315               Alc/alcThread.c
316               Alc/bs2b.c
317               Alc/mixer.c
318               Alc/panning.c
319               Alc/null.c
322 SET(BACKENDS "")
323 SET(HAVE_ALSA       0)
324 SET(HAVE_OSS        0)
325 SET(HAVE_SOLARIS    0)
326 SET(HAVE_DSOUND     0)
327 SET(HAVE_WINMM      0)
328 SET(HAVE_PORTAUDIO  0)
329 SET(HAVE_PULSEAUDIO 0)
330 SET(HAVE_WAVE       0)
332 # Check ALSA backend
333 IF(ALSA)
334     CHECK_INCLUDE_FILE(alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H)
335     IF(HAVE_ALSA_ASOUNDLIB_H)
336         CHECK_SHARED_LIBRARY_EXISTS(asound snd_pcm_open 4 "" HAVE_LIBASOUND)
337         IF(HAVE_LIBASOUND OR HAVE_DLFCN_H OR WIN32)
338             SET(HAVE_ALSA 1)
339             SET(ALC_OBJS  ${ALC_OBJS} Alc/alsa.c)
340             IF(HAVE_DLFCN_H OR WIN32)
341                 SET(BACKENDS  "${BACKENDS} ALSA,")
342             ELSE()
343                 SET(BACKENDS  "${BACKENDS} ALSA \(linked\),")
344                 SET(EXTRA_LIBS asound ${EXTRA_LIBS})
345             ENDIF()
346         ENDIF()
347     ENDIF()
348 ENDIF()
350 # Check OSS backend
351 IF(OSS)
352     CHECK_INCLUDE_FILE(sys/soundcard.h HAVE_SYS_SOUNDCARD_H)
353     IF(HAVE_SYS_SOUNDCARD_H)
354         SET(HAVE_OSS 1)
355         SET(ALC_OBJS  ${ALC_OBJS} Alc/oss.c)
356         SET(BACKENDS  "${BACKENDS} OSS,")
357     ENDIF()
358 ENDIF()
360 # Check Solaris backend
361 IF(SOLARIS)
362     CHECK_INCLUDE_FILE(sys/audioio.h HAVE_SYS_AUDIOIO_H)
363     IF(HAVE_SYS_AUDIOIO_H)
364         SET(HAVE_SOLARIS 1)
365         SET(ALC_OBJS  ${ALC_OBJS} Alc/solaris.c)
366         SET(BACKENDS  "${BACKENDS} Solaris,")
367     ENDIF()
368 ENDIF()
370 # Check DSound/MMSystem backend
371 IF(DSOUND)
372     CHECK_INCLUDE_FILE(dsound.h HAVE_DSOUND_H)
373     IF(HAVE_DSOUND_H)
374         CHECK_SHARED_LIBRARY_EXISTS(dsound DirectSoundCreate 3 "" HAVE_LIBDSOUND)
375         IF(HAVE_LIBDSOUND OR HAVE_DLFCN_H OR WIN32)
376             SET(HAVE_DSOUND 1)
377             SET(ALC_OBJS  ${ALC_OBJS} Alc/dsound.c)
379             IF(HAVE_DLFCN_H OR WIN32)
380                 SET(BACKENDS  "${BACKENDS} DirectSound,")
381             ELSE()
382                 SET(BACKENDS  "${BACKENDS} DirectSound \(linked\),")
383                 SET(EXTRA_LIBS dsound ${EXTRA_LIBS})
384             ENDIF()
385         ENDIF()
386     ENDIF()
387 ENDIF()
389 IF(HAVE_WINDOWS_H)
390     IF(WINMM)
391         CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0500)
392         IF(HAVE_MMSYSTEM_H AND HAVE_LIBWINMM)
393             SET(HAVE_WINMM 1)
394             SET(ALC_OBJS  ${ALC_OBJS} Alc/winmm.c)
395             SET(BACKENDS  "${BACKENDS} WinMM,")
396         ENDIF()
397     ENDIF()
398 ENDIF()
400 # Check PortAudio backend
401 IF(PORTAUDIO)
402     CHECK_INCLUDE_FILE(portaudio.h HAVE_PORTAUDIO_H)
403     IF(HAVE_PORTAUDIO_H)
404         CHECK_SHARED_LIBRARY_EXISTS(portaudio Pa_Initialize 0 "" HAVE_LIBPORTAUDIO)
405         IF(HAVE_LIBPORTAUDIO OR HAVE_DLFCN_H OR WIN32)
406             SET(HAVE_PORTAUDIO 1)
407             SET(ALC_OBJS  ${ALC_OBJS} Alc/portaudio.c)
408             IF(HAVE_DLFCN_H OR WIN32)
409                 SET(BACKENDS  "${BACKENDS} PortAudio,")
410             ELSE()
411                 SET(BACKENDS  "${BACKENDS} PortAudio \(linked\),")
412                 SET(EXTRA_LIBS portaudio ${EXTRA_LIBS})
413             ENDIF()
414         ENDIF()
415     ENDIF()
416 ENDIF()
418 # Check PortAudio backend
419 IF(PULSEAUDIO)
420     CHECK_INCLUDE_FILE(pulse/pulseaudio.h HAVE_PULSE_PULSEAUDIO_H)
421     IF(HAVE_PULSE_PULSEAUDIO_H)
422         CHECK_SHARED_LIBRARY_EXISTS(pulse pa_context_new 2 "" HAVE_LIBPULSE)
423         IF(HAVE_LIBPULSE OR HAVE_DLFCN_H OR WIN32)
424             SET(HAVE_PULSEAUDIO 1)
425             SET(ALC_OBJS  ${ALC_OBJS} Alc/pulseaudio.c)
426             IF(HAVE_DLFCN_H OR WIN32)
427                 SET(BACKENDS  "${BACKENDS} PulseAudio,")
428             ELSE()
429                 SET(BACKENDS  "${BACKENDS} PulseAudio \(linked\),")
430                 SET(EXTRA_LIBS pulse ${EXTRA_LIBS})
431             ENDIF()
432         ENDIF()
433     ENDIF()
434 ENDIF()
436 # Optionally enable the Wave Writer backend
437 IF(WAVE)
438     SET(HAVE_WAVE 1)
439     SET(ALC_OBJS  ${ALC_OBJS} Alc/wave.c)
440     SET(BACKENDS  "${BACKENDS} WaveFile,")
441 ENDIF()
443 # This is always available
444 SET(BACKENDS  "${BACKENDS} Null")
446 IF(LIBTYPE STREQUAL "STATIC")
447     ADD_DEFINITIONS(-DAL_LIBTYPE_STATIC)
448     SET(PKG_CONFIG_CFLAGS -DAL_LIBTYPE_STATIC ${PKG_CONFIG_CFLAGS})
449 ENDIF()
451 # Needed for openal.pc.in
452 SET(prefix ${CMAKE_INSTALL_PREFIX})
453 SET(exec_prefix "\${prefix}")
454 SET(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
455 SET(bindir "\${exec_prefix}/bin")
456 SET(includedir "\${prefix}/include")
457 SET(PACKAGE_VERSION "${LIB_VERSION}")
459 # End configuration
460 CONFIGURE_FILE(
461     "${OpenAL_SOURCE_DIR}/config.h.in"
462     "${OpenAL_BINARY_DIR}/config.h")
463 CONFIGURE_FILE(
464     "${OpenAL_SOURCE_DIR}/openal.pc.in"
465     "${OpenAL_BINARY_DIR}/openal.pc"
466     @ONLY)
468 # Build a library
469 ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${OPENAL_OBJS} ${ALC_OBJS})
470 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES DEFINE_SYMBOL AL_BUILD_LIBRARY
471                                             COMPILE_FLAGS -DAL_ALEXT_PROTOTYPES
472                                             VERSION ${LIB_VERSION}
473                                             SOVERSION ${LIB_MAJOR_VERSION})
474 IF(WIN32 AND NOT LIBTYPE STREQUAL "STATIC")
475     SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES PREFIX "")
476 ENDIF()
478 TARGET_LINK_LIBRARIES(${LIBNAME} ${EXTRA_LIBS})
480 # Add an install target here
481 INSTALL(TARGETS ${LIBNAME}
482         RUNTIME DESTINATION bin
483         LIBRARY DESTINATION "lib${LIB_SUFFIX}"
484         ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
486 INSTALL(FILES include/AL/al.h
487               include/AL/alc.h
488               include/AL/alext.h
489               include/AL/efx.h
490               include/AL/efx-creative.h
491         DESTINATION include/AL
493 INSTALL(FILES "${OpenAL_BINARY_DIR}/openal.pc"
494         DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
497 MESSAGE(STATUS "")
498 MESSAGE(STATUS "Building OpenAL with support for the following backends:")
499 MESSAGE(STATUS "    ${BACKENDS}")
500 MESSAGE(STATUS "")
502 IF(WIN32)
503     IF(NOT HAVE_DSOUND)
504         MESSAGE(STATUS "WARNING: Building the Windows version without DirectSound output")
505         MESSAGE(STATUS "         This is probably NOT what you want!")
506         MESSAGE(STATUS "")
507     ENDIF()
508 ENDIF()
510 # Install alsoft.conf configuration file
511 IF(ALSOFT_CONFIG)
512     INSTALL(FILES alsoftrc.sample
513             DESTINATION /etc/openal
514             RENAME alsoft.conf
515     )
516     MESSAGE(STATUS "Installing sample alsoft.conf")
517     MESSAGE(STATUS "")
518 ENDIF()
520 IF(UTILS)
521     ADD_EXECUTABLE(openal-info utils/openal-info.c)
522     TARGET_LINK_LIBRARIES(openal-info ${LIBNAME})
523     INSTALL(TARGETS openal-info
524             RUNTIME DESTINATION bin
525             LIBRARY DESTINATION "lib${LIB_SUFFIX}"
526             ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
527     )
528     MESSAGE(STATUS "Building utility programs")
529     MESSAGE(STATUS "")
530 ENDIF()