1 # CMakeLists.txt for ALURE
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
4 IF(COMMAND CMAKE_POLICY)
5 CMAKE_POLICY(SET CMP0003 NEW)
6 ENDIF(COMMAND CMAKE_POLICY)
8 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
10 INCLUDE(CheckCCompilerFlag)
11 INCLUDE(CheckCSourceCompiles)
12 INCLUDE(CheckFunctionExists)
13 INCLUDE(CheckIncludeFile)
14 INCLUDE(CheckIncludeFiles)
15 INCLUDE(CheckLibraryExists)
16 INCLUDE(CheckSharedLibraryExists)
17 INCLUDE(FindPkgConfig)
19 INCLUDE(CheckFileOffsetBits)
29 SET(LIB_MAJOR_VERSION "1")
30 SET(LIB_MINOR_VERSION "1")
31 SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}")
34 INCLUDE_DIRECTORIES(include "${ALURE_BINARY_DIR}")
37 OPTION(BUILD_SHARED "Build the shared version of the library" ON)
38 OPTION(BUILD_STATIC "Build the static version of the library" ON)
40 IF(NOT BUILD_SHARED AND NOT BUILD_STATIC)
41 MESSAGE(FATAL_ERROR "No libtype being built!")
42 ENDIF(NOT BUILD_SHARED AND NOT BUILD_STATIC)
44 IF(NOT CMAKE_BUILD_TYPE)
45 SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
46 "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
48 ENDIF(NOT CMAKE_BUILD_TYPE)
49 IF(NOT DEFINED CMAKE_DEBUG_POSTFIX)
50 SET(CMAKE_DEBUG_POSTFIX "" CACHE STRING
51 "Library postfix for debug builds. Normally left blank."
53 ENDIF(NOT DEFINED CMAKE_DEBUG_POSTFIX)
56 CHECK_SHARED_LIBRARY_EXISTS(stdc++ memset "" HAS_STDCXX)
58 SET(EXTRA_LIBS stdc++ ${EXTRA_LIBS})
61 CHECK_SHARED_LIBRARY_EXISTS(m pow "" HAS_LIBM)
63 SET(EXTRA_LIBS m ${EXTRA_LIBS})
66 CHECK_FILE_OFFSET_BITS()
68 ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS})
69 SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS})
70 ENDIF(_FILE_OFFSET_BITS)
72 CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO)
74 CHECK_FUNCTION_EXISTS(_fseeki64 HAVE__FSEEKI64)
75 ENDIF(NOT HAVE_FSEEKO)
77 SET(STATIC_CFLAGS "${STATIC_CFLAGS} -DALURE_STATIC_LIBRARY")
83 CHECK_C_SOURCE_COMPILES("int foo() __attribute__((constructor));
84 int main() {return 0;}" HAVE_GCC_CONSTRUCTOR)
86 CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_GCC_VISIBILITY)
87 IF(HAVE_GCC_VISIBILITY)
88 ADD_DEFINITIONS(-fvisibility=hidden)
89 ENDIF(HAVE_GCC_VISIBILITY)
91 # Force -fPIC for the static lib, because it causes problems when the
92 # static version is linked to a dynamic lib
93 SET(STATIC_CFLAGS "${STATIC_CFLAGS} -fPIC")
96 CHECK_C_COMPILER_FLAG(-Wextra HAVE_WEXTRA)
98 ADD_DEFINITIONS(-Wextra)
100 ADD_DEFINITIONS(-Wall)
102 CHECK_C_COMPILER_FLAG(-funswitch-loops HAVE_FUNSWITCH_LOOPS)
103 IF(HAVE_FUNSWITCH_LOOPS)
104 ADD_DEFINITIONS(-funswitch-loops)
105 ENDIF(HAVE_FUNSWITCH_LOOPS)
109 CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H -D_WIN32_WINNT=0x0500)
111 CHECK_INCLUDE_FILE(ddk/ntddcdrm.h HAVE_DDK_NTDDCDRM_H)
113 CHECK_C_COMPILER_FLAG(-pthread HAVE_PTHREAD)
115 ADD_DEFINITIONS(-pthread)
116 SET(EXTRA_LIBS ${EXTRA_LIBS} -pthread)
119 # We need pthreads outside of Windows
120 CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
121 IF(NOT HAVE_PTHREAD_H)
122 MESSAGE(FATAL_ERROR "PThreads is required for non-Windows builds!")
124 # Some systems need pthread_np.h to get recursive mutexes
125 CHECK_INCLUDE_FILES("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H)
127 # _GNU_SOURCE is needed on some systems for extra attributes, and
128 # _REENTRANT is needed for libc thread-safety
129 ADD_DEFINITIONS(-D_GNU_SOURCE=1)
130 CHECK_FUNCTION_EXISTS(pthread_create HAS_PTHREAD_CREATE)
131 IF(NOT HAS_PTHREAD_CREATE)
132 CHECK_SHARED_LIBRARY_EXISTS(pthread pthread_create "" HAVE_LIBPTHREAD)
133 IF(NOT HAVE_LIBPTHREAD)
134 MESSAGE(FATAL_ERROR "pthread_create not found on non-Windows target!")
135 ENDIF(NOT HAVE_LIBPTHREAD)
136 SET(EXTRA_LIBS pthread ${EXTRA_LIBS})
137 ENDIF(NOT HAS_PTHREAD_CREATE)
139 CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
140 IF(NOT HAVE_NANOSLEEP)
141 MESSAGE(FATAL_ERROR "No sleep function found!")
142 ENDIF(NOT HAVE_NANOSLEEP)
143 ENDIF(HAVE_WINDOWS_H)
145 CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
146 CHECK_INCLUDE_FILE(sys/wait.h HAVE_SYS_WAIT_H)
147 CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H)
148 CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
151 CHECK_SHARED_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
153 SET(EXTRA_LIBS dl ${EXTRA_LIBS})
157 OPTION(DYNLOAD "Dynamically load support libs at run-time" ON)
158 OPTION(SNDFILE "SoundFile support (for various formats)" ON)
159 OPTION(VORBIS "VorbisFile support (for Ogg Vorbis)" ON)
160 OPTION(FLAC "FLAC support (for FLAC and Ogg FLAC)" ON)
161 OPTION(MPG123 "MPG123 support (for MP1/MP2/MP3)" ON)
162 OPTION(DUMB "DUMB support (for IT/XM/S3M/MOD)" ON)
163 OPTION(MODPLUG "ModPlug support (for IT/XM/S3M/MOD)" OFF)
164 OPTION(FLUIDSYNTH "FluidSynth support (for MID)" ON)
167 ADD_DEFINITIONS(-D_WIN32)
169 IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
172 ELSE(CMAKE_SIZEOF_VOID_P MATCHES "8")
175 ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
177 SET(OPENAL_SEARCH_PATHS
180 "C:/Program Files/OpenAL 1.1 SDK"
181 "C:/Program Files (x86)/OpenAL 1.1 SDK"
182 "E:/Programs/Dev/OpenAL"
183 "E:/Program Files (x86)/OpenAL 1.1 SDK" )
185 FIND_PATH(OPENAL_INCLUDE_DIR al.h
186 PATHS ${OPENAL_SEARCH_PATHS}
187 PATH_SUFFIXES include include/AL )
188 IF(OPENAL_INCLUDE_DIR)
189 INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR})
190 FIND_LIBRARY(OPENAL_LIBRARIES OpenAL32
191 PATHS ${OPENAL_SEARCH_PATHS}
192 PATH_SUFFIXES lib libs/${WIN_TYPE} )
193 ENDIF(OPENAL_INCLUDE_DIR)
195 IF(NOT OPENAL_LIBRARIES)
196 MESSAGE(FATAL_ERROR "OpenAL not found!\nPlease try setting the ALSDK_DIR environment variable and try again.")
197 ENDIF(NOT OPENAL_LIBRARIES)
199 MESSAGE(STATUS "OpenAL include: ${OPENAL_INCLUDE_DIR}")
200 MESSAGE(STATUS "OpenAL lib: ${OPENAL_LIBRARIES}")
202 IF(NOT HAVE_DLFCN_H OR NOT HAVE_LIBDL)
204 ENDIF(NOT HAVE_DLFCN_H OR NOT HAVE_LIBDL)
206 PKG_CHECK_MODULES(OPENAL openal)
209 CHECK_INCLUDE_FILE(OpenAL/al.h HAVE_OPENAL_AL_H)
211 SET(OPENAL_LIBRARIES "-framework OpenAL")
213 ENDIF(HAVE_OPENAL_AL_H)
215 CHECK_INCLUDE_FILE(AL/al.h HAVE_AL_AL_H)
217 CHECK_SHARED_LIBRARY_EXISTS(openal alcOpenDevice "" HAS_OPENAL)
219 SET(OPENAL_LIBRARIES openal)
224 MESSAGE(FATAL_ERROR "OpenAL not found!")
225 ENDIF(NOT HAS_OPENAL)
226 ELSE(NOT OPENAL_FOUND)
227 INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIRS})
228 LINK_DIRECTORIES(${OPENAL_LIBRARY_DIRS})
229 ENDIF(NOT OPENAL_FOUND)
233 SET(ALURE_OBJS src/alure.cpp
245 PKG_CHECK_MODULES(SNDFILE sndfile)
246 IF(NOT SNDFILE_FOUND)
247 CHECK_INCLUDE_FILE(sndfile.h HAVE_SNDFILE_H)
249 CHECK_SHARED_LIBRARY_EXISTS(sndfile sf_open "" HAVE_LIBSNDFILE)
250 CHECK_SHARED_LIBRARY_EXISTS(libsndfile-1 sf_open "" HAVE_LIBSNDFILE1)
251 IF(DYNLOAD OR HAVE_LIBSNDFILE OR HAVE_LIBSNDFILE1)
254 SET(SNDFILE_LIBRARIES "sndfile")
255 ELSEIF(HAVE_LIBSNDFILE1)
256 SET(SNDFILE_LIBRARIES "libsndfile-1")
257 ENDIF(HAVE_LIBSNDFILE)
258 ENDIF(DYNLOAD OR HAVE_LIBSNDFILE OR HAVE_LIBSNDFILE1)
259 ENDIF(HAVE_SNDFILE_H)
260 ELSE(NOT SNDFILE_FOUND)
262 LINK_DIRECTORIES(${SNDFILE_LIBRARY_DIRS})
263 SET_SOURCE_FILES_PROPERTIES(src/codec_sndfile.cpp PROPERTIES
264 COMPILE_FLAGS "${SNDFILE_CFLAGS}")
265 ENDIF(NOT SNDFILE_FOUND)
267 SET(ALURE_OBJS ${ALURE_OBJS} src/codec_sndfile.cpp)
270 SET(SNDFILE_LIBRARIES "")
275 PKG_CHECK_MODULES(VORBISFILE vorbisfile)
276 IF(NOT VORBISFILE_FOUND)
277 CHECK_INCLUDE_FILE(vorbis/vorbisfile.h HAVE_VORBIS_VORBISFILE_H)
278 IF(HAVE_VORBIS_VORBISFILE_H)
279 CHECK_SHARED_LIBRARY_EXISTS(vorbisfile ov_open "" HAVE_LIBVORBISFILE)
280 IF(DYNLOAD OR HAVE_LIBVORBISFILE)
281 SET(HAS_VORBISFILE 1)
282 IF(HAVE_LIBVORBISFILE)
283 SET(VORBISFILE_LIBRARIES "vorbisfile")
284 ENDIF(HAVE_LIBVORBISFILE)
285 ENDIF(DYNLOAD OR HAVE_LIBVORBISFILE)
286 ENDIF(HAVE_VORBIS_VORBISFILE_H)
287 ELSE(NOT VORBISFILE_FOUND)
288 SET(HAS_VORBISFILE 1)
289 LINK_DIRECTORIES(${VORBISFILE_LIBRARY_DIRS})
290 SET_SOURCE_FILES_PROPERTIES(src/codec_vorbisfile.cpp PROPERTIES
291 COMPILE_FLAGS "${VORBISFILE_CFLAGS}")
292 ENDIF(NOT VORBISFILE_FOUND)
293 IF(NOT HAS_VORBISFILE)
294 PKG_CHECK_MODULES(VORBISIDEC vorbisidec)
295 IF(NOT VORBISIDEC_FOUND)
296 CHECK_INCLUDE_FILE(tremor/ivorbisfile.h HAVE_TREMOR_IVORBISFILE_H)
297 IF(HAVE_TREMOR_IVORBISFILE_H)
298 CHECK_SHARED_LIBRARY_EXISTS(vorbisidec ov_open "" HAVE_LIBVORBISIDEC)
299 IF(DYNLOAD OR HAVE_LIBVORBISIDEC)
300 SET(HAS_VORBISFILE 1)
301 IF(HAVE_LIBVORBISIDEC)
302 SET(VORBISFILE_LIBRARIES "vorbisidec")
303 ENDIF(HAVE_LIBVORBISIDEC)
304 SET_SOURCE_FILES_PROPERTIES(src/codec_vorbisfile.cpp PROPERTIES
305 COMPILE_FLAGS "-DHAS_VORBISIDEC")
306 ENDIF(DYNLOAD OR HAVE_LIBVORBISIDEC)
307 ENDIF(HAVE_TREMOR_IVORBISFILE_H)
308 ELSE(NOT VORBISIDEC_FOUND)
309 SET(HAS_VORBISFILE 1)
310 LINK_DIRECTORIES(${VORBISIDEC_LIBRARY_DIRS})
311 SET_SOURCE_FILES_PROPERTIES(src/codec_vorbisfile.cpp PROPERTIES
312 COMPILE_FLAGS "${VORBISIDEC_CFLAGS} -DHAS_VORBISIDEC")
313 ENDIF(NOT VORBISIDEC_FOUND)
314 ENDIF(NOT HAS_VORBISFILE)
316 SET(ALURE_OBJS ${ALURE_OBJS} src/codec_vorbisfile.cpp)
317 ENDIF(HAS_VORBISFILE)
319 SET(VORBISFILE_LIBRARIES "")
324 #PKG_CHECK_MODULES(LIBFLAC flac)
325 #IF(NOT LIBFLAC_FOUND)
326 CHECK_INCLUDE_FILE(FLAC/all.h HAVE_FLAC_ALL_H)
328 CHECK_SHARED_LIBRARY_EXISTS(FLAC FLAC__stream_decoder_new "" HAVE_LIBFLAC)
329 IF(DYNLOAD OR HAVE_LIBFLAC)
332 SET(LIBFLAC_LIBRARIES "FLAC")
334 ENDIF(DYNLOAD OR HAVE_LIBFLAC)
335 ENDIF(HAVE_FLAC_ALL_H)
336 #ELSE(NOT LIBFLAC_FOUND)
338 # INCLUDE_DIRECTORIES(${LIBFLAC_INCLUDE_DIRS})
339 # LINK_DIRECTORIES(${LIBFLAC_LIBRARY_DIRS})
340 #ENDIF(NOT LIBFLAC_FOUND)
342 SET(ALURE_OBJS ${ALURE_OBJS} src/codec_flac.cpp)
345 SET(LIBFLAC_LIBRARIES "")
350 PKG_CHECK_MODULES(MPG123 libmpg123)
352 CHECK_INCLUDE_FILE(mpg123.h HAVE_MPG123_H)
354 CHECK_SHARED_LIBRARY_EXISTS(mpg123 mpg123_init "" HAVE_LIBMPG123)
355 IF(DYNLOAD OR HAVE_LIBMPG123)
358 SET(MPG123_LIBRARIES "mpg123")
359 ENDIF(HAVE_LIBMPG123)
360 ENDIF(DYNLOAD OR HAVE_LIBMPG123)
362 ELSE(NOT MPG123_FOUND)
364 LINK_DIRECTORIES(${MPG123_LIBRARY_DIRS})
365 SET_SOURCE_FILES_PROPERTIES(src/codec_mpg123.cpp PROPERTIES
366 COMPILE_FLAGS "${MPG123_CFLAGS}")
367 ENDIF(NOT MPG123_FOUND)
369 SET(ALURE_OBJS ${ALURE_OBJS} src/codec_mpg123.cpp)
372 SET(MPG123_LIBRARIES "")
377 CHECK_INCLUDE_FILE(dumb.h HAVE_DUMB_H)
380 CHECK_LIBRARY_EXISTS("dumb;m" dumbfile_open_ex "" HAVE_LIBDUMB)
382 CHECK_LIBRARY_EXISTS(dumb dumbfile_open_ex "" HAVE_LIBDUMB)
384 IF(DYNLOAD OR HAVE_LIBDUMB)
387 SET(DUMB_LIBRARIES dumb)
389 ENDIF(DYNLOAD OR HAVE_LIBDUMB)
392 SET(ALURE_OBJS ${ALURE_OBJS} src/codec_dumb.cpp)
395 SET(DUMB_LIBRARIES "")
400 PKG_CHECK_MODULES(MODPLUG libmodplug)
401 IF(NOT MODPLUG_FOUND)
402 CHECK_INCLUDE_FILE(modplug.h HAVE_MODPLUG_H)
404 CHECK_SHARED_LIBRARY_EXISTS(modplug ModPlug_Load "" HAVE_LIBMODPLUG)
405 IF(DYNLOAD OR HAVE_LIBMODPLUG)
408 SET(MODPLUG_LIBRARIES "modplug")
409 ENDIF(HAVE_LIBMODPLUG)
410 ENDIF(DYNLOAD OR HAVE_LIBMODPLUG)
411 ENDIF(HAVE_MODPLUG_H)
412 ELSE(NOT MODPLUG_FOUND)
414 LINK_DIRECTORIES(${MODPLUG_LIBRARY_DIRS})
415 SET_SOURCE_FILES_PROPERTIES(src/codec_modplug.cpp PROPERTIES
416 COMPILE_FLAGS "${MODPLUG_CFLAGS}")
417 ENDIF(NOT MODPLUG_FOUND)
419 SET(ALURE_OBJS ${ALURE_OBJS} src/codec_modplug.cpp)
422 SET(MODPLUG_LIBRARIES "")
427 PKG_CHECK_MODULES(FLUIDSYNTH fluidsynth>=1.1.1)
428 IF(NOT FLUIDSYNTH_FOUND)
429 CHECK_INCLUDE_FILE(fluidsynth.h HAVE_FLUIDSYNTH_H)
430 IF(HAVE_FLUIDSYNTH_H)
431 CHECK_SHARED_LIBRARY_EXISTS(fluidsynth new_fluid_synth "" HAVE_LIBFLUIDSYNTH)
432 IF(DYNLOAD OR HAVE_LIBFLUIDSYNTH)
433 SET(HAS_FLUIDSYNTH 1)
434 IF(HAVE_LIBFLUIDSYNTH)
435 SET(FLUIDSYNTH_LIBRARIES "fluidsynth")
436 ENDIF(HAVE_LIBFLUIDSYNTH)
437 ENDIF(DYNLOAD OR HAVE_LIBFLUIDSYNTH)
438 ENDIF(HAVE_FLUIDSYNTH_H)
439 ELSE(NOT FLUIDSYNTH_FOUND)
440 SET(HAS_FLUIDSYNTH 1)
441 LINK_DIRECTORIES(${FLUIDSYNTH_LIBRARY_DIRS})
442 SET_SOURCE_FILES_PROPERTIES(src/codec_fluidsynth.cpp PROPERTIES
443 COMPILE_FLAGS "${FLUIDSYNTH_CFLAGS}")
444 ENDIF(NOT FLUIDSYNTH_FOUND)
446 SET(ALURE_OBJS ${ALURE_OBJS} src/codec_fluidsynth.cpp)
447 ENDIF(HAS_FLUIDSYNTH)
449 SET(FLUIDSYNTH_LIBRARIES "")
454 SET(EXTRA_LIBS ${SNDFILE_LIBRARIES} ${VORBISFILE_LIBRARIES} ${LIBFLAC_LIBRARIES} ${MPG123_LIBRARIES} ${DUMB_LIBRARIES} ${MODPLUG_LIBRARIES} ${FLUIDSYNTH_LIBRARIES} ${EXTRA_LIBS})
456 ADD_DEFINITIONS(-DDYNLOAD=1)
460 SET(prefix ${CMAKE_INSTALL_PREFIX})
461 SET(exec_prefix "\${prefix}")
462 SET(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
463 SET(bindir "\${exec_prefix}/bin")
464 SET(includedir "\${prefix}/include")
465 SET(PKG_CONFIG_REQUIRES openal)
466 SET(PACKAGE_VERSION "${LIB_VERSION}")
470 "${ALURE_SOURCE_DIR}/config.h.in"
471 "${ALURE_BINARY_DIR}/config.h")
474 "${ALURE_SOURCE_DIR}/alure.pc.in"
475 "${ALURE_BINARY_DIR}/alure.pc"
480 "${ALURE_SOURCE_DIR}/alure-static.pc.in"
481 "${ALURE_BINARY_DIR}/alure-static.pc"
485 ADD_DEFINITIONS(-DHAVE_CONFIG_H)
489 #build a shared library
490 ADD_LIBRARY(${LIBNAME} SHARED ${ALURE_OBJS})
491 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES DEFINE_SYMBOL ALURE_BUILD_LIBRARY
492 VERSION ${LIB_VERSION}.0
493 SOVERSION ${LIB_MAJOR_VERSION})
495 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES PREFIX "")
497 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES LINK_FLAGS "-Wl,--version-script=${ALURE_SOURCE_DIR}/libalure.map")
499 TARGET_LINK_LIBRARIES(${LIBNAME} ${OPENAL_LIBRARIES} ${EXTRA_LIBS})
501 INSTALL(TARGETS ${LIBNAME}
502 RUNTIME DESTINATION bin
503 LIBRARY DESTINATION lib${LIB_SUFFIX}
504 ARCHIVE DESTINATION lib${LIB_SUFFIX}
508 #build a static library
509 ADD_LIBRARY(${LIBNAME}-static STATIC ${ALURE_OBJS})
510 SET_TARGET_PROPERTIES(${LIBNAME}-static PROPERTIES DEFINE_SYMBOL ALURE_BUILD_LIBRARY
511 COMPILE_FLAGS ${STATIC_CFLAGS}
512 VERSION ${LIB_VERSION}.0)
513 INSTALL(TARGETS ${LIBNAME}-static
514 RUNTIME DESTINATION bin
515 LIBRARY DESTINATION lib${LIB_SUFFIX}
516 ARCHIVE DESTINATION lib${LIB_SUFFIX}
521 IF(HAVE_DDK_NTDDCDRM_H)
522 SET_SOURCE_FILES_PROPERTIES(examples/alurecdplay.c PROPERTIES
523 COMPILE_FLAGS "-DHAVE_DDK_NTDDCDRM_H")
524 ENDIF(HAVE_DDK_NTDDCDRM_H)
525 ADD_EXECUTABLE(alureplay examples/alureplay.c)
526 ADD_EXECUTABLE(alurecdplay examples/alurecdplay.c)
527 ADD_EXECUTABLE(alurestream examples/alurestream.c)
529 TARGET_LINK_LIBRARIES(alureplay ${LIBNAME} ${OPENAL_LIBRARIES} ${EXTRA_LIBS})
530 TARGET_LINK_LIBRARIES(alurecdplay ${LIBNAME} ${OPENAL_LIBRARIES} ${EXTRA_LIBS})
531 TARGET_LINK_LIBRARIES(alurestream ${LIBNAME} ${OPENAL_LIBRARIES} ${EXTRA_LIBS})
533 SET_TARGET_PROPERTIES(alureplay PROPERTIES COMPILE_FLAGS -DALURE_STATIC_LIBRARY)
534 SET_TARGET_PROPERTIES(alurecdplay PROPERTIES COMPILE_FLAGS -DALURE_STATIC_LIBRARY)
535 SET_TARGET_PROPERTIES(alurestream PROPERTIES COMPILE_FLAGS -DALURE_STATIC_LIBRARY)
536 TARGET_LINK_LIBRARIES(alureplay ${LIBNAME}-static ${OPENAL_LIBRARIES} ${EXTRA_LIBS})
537 TARGET_LINK_LIBRARIES(alurecdplay ${LIBNAME}-static ${OPENAL_LIBRARIES} ${EXTRA_LIBS})
538 TARGET_LINK_LIBRARIES(alurestream ${LIBNAME}-static ${OPENAL_LIBRARIES} ${EXTRA_LIBS})
542 FIND_PROGRAM(NATDOCS_BIN NaturalDocs)
544 ADD_CUSTOM_TARGET(docs
545 "${NATDOCS_BIN}" -i "${ALURE_SOURCE_DIR}/src" -o HTML "${ALURE_SOURCE_DIR}/docs/html" -p "${ALURE_SOURCE_DIR}/docs/naturaldocs" -s Default CustomStyle
546 COMMENT "Building NaturalDocs documentation..." VERBATIM)
548 MESSAGE(STATUS "\nNaturalDocs not found; building documentation is disabled")
552 #add an install target here
559 INSTALL(DIRECTORY "${ALURE_SOURCE_DIR}/docs/html"
560 DESTINATION share/doc/alure
562 INSTALL(FILES include/AL/alure.h
563 DESTINATION "include/${INCPATH}"
566 INSTALL(FILES "${ALURE_BINARY_DIR}/alure.pc"
567 DESTINATION "lib${LIB_SUFFIX}/pkgconfig"
571 INSTALL(FILES "${ALURE_BINARY_DIR}/alure-static.pc"
572 DESTINATION "lib${LIB_SUFFIX}/pkgconfig"
577 MESSAGE(STATUS "\n********************** Configured options **********************")
578 IF(BUILD_SHARED AND BUILD_STATIC)
579 MESSAGE(STATUS "Building shared, static library")
581 MESSAGE(STATUS "Building shared library")
582 ELSE(BUILD_SHARED AND BUILD_STATIC)
583 MESSAGE(STATUS "Building static library")
584 ENDIF(BUILD_SHARED AND BUILD_STATIC)
587 MESSAGE(STATUS "SndFile support: enabled")
589 MESSAGE(STATUS "SndFile support: disabled")
592 MESSAGE(STATUS "VorbisFile support: enabled")
594 MESSAGE(STATUS "VorbisFile support: disabled")
595 ENDIF(HAS_VORBISFILE)
597 MESSAGE(STATUS "FLAC support: enabled")
599 MESSAGE(STATUS "FLAC support: disabled")
602 MESSAGE(STATUS "MPG123 support: enabled")
604 MESSAGE(STATUS "MPG123 support: disabled")
607 MESSAGE(STATUS "DUMB support: enabled")
609 MESSAGE(STATUS "DUMB support: disabled")
612 MESSAGE(STATUS "ModPlug support: enabled")
614 MESSAGE(STATUS "ModPlug support: disabled")
617 MESSAGE(STATUS "FluidSynth support: enabled")
619 MESSAGE(STATUS "FluidSynth support: disabled")
620 ENDIF(HAS_FLUIDSYNTH)