Make sure to get as much data from mpg123 as will fit
[alure.git] / CMakeLists.txt
blobaf4ce90f082751ff9eba9c106646472e8d0dafd0
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)
18 INCLUDE(UsePkgConfig)
19 INCLUDE(CheckFileOffsetBits)
21 PROJECT(ALURE)
23 IF(WIN32)
24     SET(LIBNAME ALURE32)
25 ELSE(WIN32)
26     SET(LIBNAME alure)
27 ENDIF(WIN32)
29 SET(LIB_MAJOR_VERSION "1")
30 SET(LIB_MINOR_VERSION "0")
31 SET(LIB_BUILD_VERSION "72")
32 SET(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_BUILD_VERSION}")
33 IF(NOT DEFINED LIB_INSTALL_DIR)
34     SET(LIB_INSTALL_DIR "lib${LIB_SUFFIX}")
35 ENDIF(NOT DEFINED LIB_INSTALL_DIR)
38 INCLUDE_DIRECTORIES(include "${ALURE_BINARY_DIR}")
41 OPTION(NO_SHARED "Build a static library instead of shared" OFF)
43 IF(NOT CMAKE_BUILD_TYPE)
44     SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
45         "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
46         FORCE)
47 ENDIF(NOT CMAKE_BUILD_TYPE)
48 IF(NOT DEFINED CMAKE_DEBUG_POSTFIX)
49     SET(CMAKE_DEBUG_POSTFIX "" CACHE STRING
50         "Library postfix for debug builds. Normally left blank."
51         FORCE)
52 ENDIF(NOT DEFINED CMAKE_DEBUG_POSTFIX)
55 ADD_DEFINITIONS(-DALURE_BUILD_LIBRARY -DHAVE_CONFIG_H)
57 CHECK_SHARED_LIBRARY_EXISTS(stdc++ memset "" HAS_STDCXX)
58 IF(HAS_STDCXX)
59     SET(EXTRA_LIBS stdc++ ${EXTRA_LIBS})
60 ENDIF(HAS_STDCXX)
62 CHECK_SHARED_LIBRARY_EXISTS(m pow "" HAS_LIBM)
63 IF(HAS_LIBM)
64     SET(EXTRA_LIBS m ${EXTRA_LIBS})
65 ENDIF(HAS_LIBM)
67 CHECK_FILE_OFFSET_BITS()
68 IF(_FILE_OFFSET_BITS)
69     ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS})
70     SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS})
71 ENDIF(_FILE_OFFSET_BITS)
73 CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO)
75 IF(MSVC)
76     # ???
77 ELSE(MSVC)
78     IF(NOT WIN32)
79         CHECK_C_SOURCE_COMPILES("int foo() __attribute__((constructor));
80                                  int main() {return 0;}" HAVE_GCC_CONSTRUCTOR)
82         CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_GCC_VISIBILITY)
83         IF(HAVE_GCC_VISIBILITY)
84             ADD_DEFINITIONS(-fvisibility=hidden)
85         ENDIF(HAVE_GCC_VISIBILITY)
86     ENDIF(NOT WIN32)
88     CHECK_C_COMPILER_FLAG(-Wextra HAVE_WEXTRA)
89     IF(HAVE_WEXTRA)
90         ADD_DEFINITIONS(-Wextra)
91     ENDIF(HAVE_WEXTRA)
92     ADD_DEFINITIONS(-Wall)
94     CHECK_C_COMPILER_FLAG(-funswitch-loops HAVE_FUNSWITCH_LOOPS)
95     IF(HAVE_FUNSWITCH_LOOPS)
96         ADD_DEFINITIONS(-funswitch-loops)
97     ENDIF(HAVE_FUNSWITCH_LOOPS)
98 ENDIF(MSVC)
101 CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H -D_WIN32_WINNT=0x0500)
102 IF(NOT HAVE_WINDOWS_H)
103     CHECK_C_COMPILER_FLAG(-pthread HAVE_PTHREAD)
104     IF(HAVE_PTHREAD)
105         ADD_DEFINITIONS(-pthread)
106         SET(EXTRA_LIBS ${EXTRA_LIBS} -pthread)
107     ENDIF(HAVE_PTHREAD)
109     # We need pthreads outside of Windows
110     CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
111     IF(NOT HAVE_PTHREAD_H)
112         MESSAGE(FATAL_ERROR "PThreads is required for non-Windows builds!")
113     ENDIF()
114     # Some systems need pthread_np.h to get recursive mutexes
115     CHECK_INCLUDE_FILES("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H)
117     # _GNU_SOURCE is needed on some systems for extra attributes, and
118     # _REENTRANT is needed for libc thread-safety
119     ADD_DEFINITIONS(-D_GNU_SOURCE=1)
120     CHECK_FUNCTION_EXISTS(pthread_create HAS_PTHREAD_CREATE)
121     IF(NOT HAS_PTHREAD_CREATE)
122         CHECK_SHARED_LIBRARY_EXISTS(pthread pthread_create "" HAVE_LIBPTHREAD)
123         IF(NOT HAVE_LIBPTHREAD)
124             MESSAGE(FATAL_ERROR "pthread_create not found on non-Windows target!")
125         ENDIF(NOT HAVE_LIBPTHREAD)
126         SET(EXTRA_LIBS pthread ${EXTRA_LIBS})
127     ENDIF(NOT HAS_PTHREAD_CREATE)
129     CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
130     IF(NOT HAVE_NANOSLEEP)
131         MESSAGE(FATAL_ERROR "No sleep function found!")
132     ENDIF(NOT HAVE_NANOSLEEP)
133 ENDIF(NOT HAVE_WINDOWS_H)
135 CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
136 CHECK_INCLUDE_FILE(sys/wait.h HAVE_SYS_WAIT_H)
137 CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H)
140 OPTION(SNDFILE   "SoundFile support (for various formats)" ON)
141 OPTION(VORBIS    "VorbisFile support (for Ogg Vorbis)"  ON)
142 OPTION(FLAC      "FLAC support (for FLAC and Ogg FLAC)" ON)
143 OPTION(MPG123    "MPG123 support (for MP1/MP2/MP3)" ON)
144 OPTION(DUMB      "DUMB support (for IT/XM/S3M/MOD)" ON)
145 OPTION(TIMIDITY  "Timidity support (for MIDI/MUS)" ON)
146 OPTION(GSTREAMER "GStreamer support" OFF)
148 IF(WIN32)
149     ADD_DEFINITIONS(-D_WIN32)
151     IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
152         SET(WIN_TYPE Win64)
153         SET(XBITS x64)
154     ELSE(CMAKE_SIZEOF_VOID_P MATCHES "8")
155         SET(WIN_TYPE Win32)
156         SET(XBITS x86)
157     ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
159     SET(OPENAL_SEARCH_PATHS
160         ENV ALSDK_DIR
161         ENV MINGDIR
162         "C:/Program Files/OpenAL 1.1 SDK"
163         "C:/Program Files (x86)/OpenAL 1.1 SDK"
164         "E:/Programs/Dev/OpenAL"
165         "E:/Program Files (x86)/OpenAL 1.1 SDK" )
167     FIND_PATH(OPENAL_INCLUDE_DIR al.h
168               PATHS ${OPENAL_SEARCH_PATHS}
169               PATH_SUFFIXES include include/AL )
170     IF(OPENAL_INCLUDE_DIR)
171         INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR})
172         FIND_LIBRARY(OPENAL_LIBRARIES OpenAL32
173                      PATHS ${OPENAL_SEARCH_PATHS}
174                      PATH_SUFFIXES lib libs/${WIN_TYPE} )
175     ENDIF(OPENAL_INCLUDE_DIR)
177     IF(NOT OPENAL_LIBRARIES)
178         MESSAGE(FATAL_ERROR "OpenAL not found!\nPlease try setting the ALSDK_DIR environment variable and try again.")
179     ENDIF(NOT OPENAL_LIBRARIES)
181     MESSAGE(STATUS "OpenAL include: ${OPENAL_INCLUDE_DIR}")
182     MESSAGE(STATUS "OpenAL lib: ${OPENAL_LIBRARIES}")
183 ELSE(WIN32)
184     PKG_CHECK_MODULES(OPENAL openal)
185     IF(NOT OPENAL_FOUND)
186         IF(APPLE)
187             CHECK_INCLUDE_FILE(OpenAL/al.h HAVE_OPENAL_AL_H)
188             IF(HAVE_OPENAL_AL_H)
189                 SET(OPENAL_LIBRARIES "-framework OpenAL")
190                 SET(HAS_OPENAL 1)
191             ENDIF(HAVE_OPENAL_AL_H)
192         ELSE(APPLE)
193             CHECK_INCLUDE_FILE(AL/al.h HAVE_AL_AL_H)
194             IF(HAVE_AL_AL_H)
195                 CHECK_SHARED_LIBRARY_EXISTS(openal alcOpenDevice "" HAS_OPENAL)
196                 IF(HAS_OPENAL)
197                     SET(OPENAL_LIBRARIES openal)
198                 ENDIF(HAS_OPENAL)
199             ENDIF(HAVE_AL_AL_H)
200         ENDIF(APPLE)
201         IF(NOT HAS_OPENAL)
202             MESSAGE(FATAL_ERROR "OpenAL not found!")
203         ENDIF(NOT HAS_OPENAL)
204     ELSE(NOT OPENAL_FOUND)
205         INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIRS})
206         LINK_DIRECTORIES(${OPENAL_LIBRARY_DIRS})
207     ENDIF(NOT OPENAL_FOUND)
208 ENDIF(WIN32)
210 # SndFile support
211 IF(SNDFILE)
212     PKG_CHECK_MODULES(SNDFILE sndfile)
213     IF(NOT SNDFILE_FOUND)
214         CHECK_INCLUDE_FILE(sndfile.h HAVE_SNDFILE_H)
215         IF(HAVE_SNDFILE_H)
216             CHECK_SHARED_LIBRARY_EXISTS(sndfile sf_open "" HAS_SNDFILE)
217             IF(HAS_SNDFILE)
218                 SET(SNDFILE_LIBRARIES "sndfile")
219             ELSE(HAS_SNDFILE)
220                 CHECK_SHARED_LIBRARY_EXISTS(libsndfile-1 sf_open "" HAS_LIBSNDFILE1)
221                 IF(HAS_LIBSNDFILE1)
222                     SET(HAS_SNDFILE 1)
223                     SET(SNDFILE_LIBRARIES "libsndfile-1")
224                 ENDIF(HAS_LIBSNDFILE1)
225             ENDIF(HAS_SNDFILE)
226         ENDIF(HAVE_SNDFILE_H)
227     ELSE(NOT SNDFILE_FOUND)
228         SET(HAS_SNDFILE 1)
229         INCLUDE_DIRECTORIES(${SNDFILE_INCLUDE_DIRS})
230         LINK_DIRECTORIES(${SNDFILE_LIBRARY_DIRS})
231     ENDIF(NOT SNDFILE_FOUND)
232 ELSE(SNDFILE)
233     SET(SNDFILE_LIBRARIES "")
234 ENDIF(SNDFILE)
236 # Vorbis support
237 IF(VORBIS)
238     PKG_CHECK_MODULES(VORBISFILE vorbisfile)
239     IF(NOT VORBISFILE_FOUND)
240         CHECK_INCLUDE_FILE(vorbis/vorbisfile.h HAVE_VORBIS_VORBISFILE_H)
241         IF(HAVE_VORBIS_VORBISFILE_H)
242             CHECK_SHARED_LIBRARY_EXISTS(vorbisfile ov_open "" HAS_VORBISFILE)
243             IF(HAS_VORBISFILE)
244                 SET(VORBISFILE_LIBRARIES "vorbisfile")
245             ENDIF(HAS_VORBISFILE)
246         ENDIF(HAVE_VORBIS_VORBISFILE_H)
247     ELSE(NOT VORBISFILE_FOUND)
248         SET(HAS_VORBISFILE 1)
249         INCLUDE_DIRECTORIES(${VORBISFILE_INCLUDE_DIRS})
250         LINK_DIRECTORIES(${VORBISFILE_LIBRARY_DIRS})
251     ENDIF(NOT VORBISFILE_FOUND)
252 ELSE(VORBIS)
253     SET(VORBISFILE_LIBRARIES "")
254 ENDIF(VORBIS)
256 # FLAC support
257 IF(FLAC)
258     #PKG_CHECK_MODULES(LIBFLAC flac)
259     #IF(NOT LIBFLAC_FOUND)
260         CHECK_INCLUDE_FILE(FLAC/all.h HAVE_FLAC_ALL_H)
261         IF(HAVE_FLAC_ALL_H)
262             CHECK_SHARED_LIBRARY_EXISTS(FLAC FLAC__stream_decoder_new "" HAS_FLAC)
263             IF(HAS_FLAC)
264                 SET(LIBFLAC_LIBRARIES "FLAC")
265             ENDIF(HAS_FLAC)
266         ENDIF(HAVE_FLAC_ALL_H)
267     #ELSE(NOT LIBFLAC)
268     #    SET(HAS_FLAC 1)
269     #    INCLUDE_DIRECTORIES(${LIBFLAC_INCLUDE_DIRS})
270     #    LINK_DIRECTORIES(${LIBFLAC_LIBRARY_DIRS})
271     #ENDIF(NOT LIBFLAC_FOUND)
272 ELSE(FLAC)
273     SET(LIBFLAC_LIBRARIES "")
274 ENDIF(FLAC)
276 # MPG123 support
277 IF(MPG123)
278     PKG_CHECK_MODULES(MPG123 libmpg123)
279     IF(NOT MPG123_FOUND)
280         CHECK_INCLUDE_FILE(mpg123.h HAVE_MPG123_H)
281         IF(HAVE_MPG123_H)
282             CHECK_SHARED_LIBRARY_EXISTS(mpg123 mpg123_init "" HAS_MPG123)
283             IF(HAS_MPG123)
284                 SET(MPG123_LIBRARIES "mpg123")
285             ENDIF(HAS_MPG123)
286         ENDIF(HAVE_MPG123_H)
287     ELSE(NOT MPG123_FOUND)
288         SET(HAS_MPG123 1)
289         INCLUDE_DIRECTORIES(${MPG123_INCLUDE_DIRS})
290         LINK_DIRECTORIES(${MPG123_LIBRARY_DIRS})
291     ENDIF(NOT MPG123_FOUND)
292 ELSE(MPG123)
293     SET(MPG123_LIBRARIES "")
294 ENDIF(MPG123)
296 # DUMB support
297 IF(DUMB)
298     CHECK_INCLUDE_FILE(dumb.h HAVE_DUMB_H)
299     IF(HAVE_DUMB_H)
300         IF(HAS_LIBM)
301             CHECK_SHARED_LIBRARY_EXISTS("dumb;m" dumbfile_open_ex "" HAS_DUMB)
302         ELSE(HAS_LIBM)
303             CHECK_SHARED_LIBRARY_EXISTS(dumb dumbfile_open_ex "" HAS_DUMB)
304         ENDIF(HAS_LIBM)
305         IF(HAS_DUMB)
306             SET(DUMB_LIBRARIES dumb)
307         ENDIF(HAS_DUMB)
308     ENDIF(HAVE_DUMB_H)
309 ELSE(DUMB)
310     SET(DUMB_LIBRARIES "")
311 ENDIF(DUMB)
313 IF(TIMIDITY)
314     CHECK_FUNCTION_EXISTS(fork HAVE_FORK)
315     CHECK_FUNCTION_EXISTS(pipe HAVE_PIPE)
316     CHECK_FUNCTION_EXISTS(kill HAVE_KILL)
317     CHECK_FUNCTION_EXISTS(open HAVE_OPEN)
318     IF(HAVE_OPEN AND HAVE_KILL AND HAVE_PIPE AND HAVE_FORK)
319         SET(HAS_TIMIDITY 1)
320     ELSE(HAVE_OPEN AND HAVE_KILL AND HAVE_PIPE AND HAVE_FORK)
321         SET(HAS_TIMIDITY 0)
322     ENDIF(HAVE_OPEN AND HAVE_KILL AND HAVE_PIPE AND HAVE_FORK)
323 ENDIF(TIMIDITY)
325 # GStreamer support
326 IF(GSTREAMER)
327     PKG_CHECK_MODULES(GST gstreamer-0.10;gstreamer-plugins-base-0.10)
328     IF(GST_FOUND)
329         CHECK_SHARED_LIBRARY_EXISTS(gstapp-0.10 gst_app_sink_pull_buffer "" HAS_GSTAPP)
330         IF(HAS_GSTAPP)
331             SET(HAS_GSTREAMER 1)
332             INCLUDE_DIRECTORIES(${GST_INCLUDE_DIRS})
333             LINK_DIRECTORIES(${GST_LIBRARY_DIRS})
334             SET(EXTRA_LIBS gstapp-0.10 ${EXTRA_LIBS})
335         ENDIF(HAS_GSTAPP)
336     ELSE(GST_FOUND)
337         SET(GST_SEARCH_PATHS
338             ENV GSTSDK_DIR
339             ENV MINGDIR
340             "C:/Program Files/gstreamer"
341             "C:/gstreamer" )
343         MESSAGE(STATUS "Looking for glib.h")
344         FIND_PATH(GLIB_INCLUDE_DIR glib.h
345                   PATHS ${GST_SEARCH_PATHS}
346                   PATH_SUFFIXES include include/glib-2.0)
347         IF(GLIB_INCLUDE_DIR)
348             MESSAGE(STATUS "Looking for glib.h - found: ${GLIB_INCLUDE_DIR}")
349         ELSE(GLIB_INCLUDE_DIR)
350             MESSAGE(STATUS "Looking for glib.h - not found")
351         ENDIF(GLIB_INCLUDE_DIR)
353         MESSAGE(STATUS "Looking for gst/gst.h")
354         FIND_PATH(GST_INCLUDE_DIR gst/gst.h
355                   PATHS ${GST_SEARCH_PATHS}
356                   PATH_SUFFIXES include include/gstreamer-0.10)
357         IF(GST_INCLUDE_DIR)
358             MESSAGE(STATUS "Looking for gst/gst.h - found: ${GST_INCLUDE_DIR}")
359         ELSE(GST_INCLUDE_DIR)
360             MESSAGE(STATUS "Looking for gst/gst.h - not found")
361         ENDIF(GST_INCLUDE_DIR)
363         IF(GLIB_INCLUDE_DIR AND GST_INCLUDE_DIR)
364             INCLUDE_DIRECTORIES("${GLIB_INCLUDE_DIR}" "${GST_INCLUDE_DIR}")
365             FIND_LIBRARY(GST_LIBRARY1 NAMES gstapp-0.10
366                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
367             FIND_LIBRARY(GST_LIBRARY2 NAMES gstreamer-0.10
368                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
369             FIND_LIBRARY(GST_LIBRARY3 NAMES gthread-2.0
370                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
371             FIND_LIBRARY(GST_LIBRARY4 NAMES gmodule-2.0
372                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
373             FIND_LIBRARY(GST_LIBRARY5 NAMES gobject-2.0
374                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
375             FIND_LIBRARY(GST_LIBRARY6 NAMES glib-2.0
376                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
377             IF(GST_LIBRARY1 AND GST_LIBRARY2 AND GST_LIBRARY3 AND GST_LIBRARY4 AND GST_LIBRARY5 AND GST_LIBRARY6)
378                 SET(GST_LIBRARIES "${GST_LIBRARY1}" "${GST_LIBRARY2}" "${GST_LIBRARY3}" "${GST_LIBRARY4}" "${GST_LIBRARY5}" "${GST_LIBRARY6}")
379                 MESSAGE(STATUS "GStreamer libs: ${GST_LIBRARIES}")
380                 SET(HAS_GSTREAMER 1)
381             ENDIF(GST_LIBRARY1 AND GST_LIBRARY2 AND GST_LIBRARY3 AND GST_LIBRARY4 AND GST_LIBRARY5 AND GST_LIBRARY6)
382         ENDIF(GLIB_INCLUDE_DIR AND GST_INCLUDE_DIR)
383     ENDIF(GST_FOUND)
384 ELSE(GSTREAMER)
385     SET(GST_LIBRARIES "")
386 ENDIF(GSTREAMER)
389 # For alure.pc.in
390 SET(prefix ${CMAKE_INSTALL_PREFIX})
391 SET(exec_prefix "\${prefix}")
392 SET(libdir "\${exec_prefix}/${LIB_INSTALL_DIR}")
393 SET(bindir "\${exec_prefix}/bin")
394 SET(includedir "\${prefix}/include")
395 SET(PKG_CONFIG_REQUIRES openal)
396 SET(PACKAGE_VERSION "${LIB_VERSION}")
398 # End configuration
399 CONFIGURE_FILE(
400     "${ALURE_SOURCE_DIR}/config.h.in"
401     "${ALURE_BINARY_DIR}/config.h")
402 CONFIGURE_FILE(
403     "${ALURE_SOURCE_DIR}/alure.pc.in"
404     "${ALURE_BINARY_DIR}/alure.pc"
405     @ONLY)
408 SET(ALURE_OBJS  src/alure.cpp
409                 src/buffer.cpp
410                 src/istream.cpp
411                 src/stream.cpp
412                 src/streamdec.cpp
413                 src/streamplay.cpp
416 IF(NOT NO_SHARED)
417     #build a shared library
418     ADD_LIBRARY(${LIBNAME} SHARED ${ALURE_OBJS})
419     SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES VERSION ${LIB_VERSION}
420                                                 SOVERSION ${LIB_MAJOR_VERSION})
421     IF(WIN32)
422         SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES PREFIX "")
423     ENDIF(WIN32)
424     TARGET_LINK_LIBRARIES(${LIBNAME} ${OPENAL_LIBRARIES} ${SNDFILE_LIBRARIES} ${VORBISFILE_LIBRARIES} ${LIBFLAC_LIBRARIES} ${MPG123_LIBRARIES} ${DUMB_LIBRARIES} ${GST_LIBRARIES} ${EXTRA_LIBS})
425 ELSE(NOT NO_SHARED)
426     #build a static library
427     ADD_LIBRARY(${LIBNAME} STATIC ${ALURE_OBJS})
428     SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES VERSION ${LIB_VERSION})
429 ENDIF(NOT NO_SHARED)
432 ADD_EXECUTABLE(alureplay examples/alureplay.c)
433 TARGET_LINK_LIBRARIES(alureplay ${LIBNAME} ${OPENAL_LIBRARIES} ${SNDFILE_LIBRARIES} ${VORBISFILE_LIBRARIES} ${LIBFLAC_LIBRARIES} ${MPG123_LIBRARIES} ${DUMB_LIBRARIES} ${GST_LIBRARIES} ${EXTRA_LIBS})
435 ADD_EXECUTABLE(alurestream examples/alurestream.c)
436 TARGET_LINK_LIBRARIES(alurestream ${LIBNAME} ${OPENAL_LIBRARIES} ${SNDFILE_LIBRARIES} ${VORBISFILE_LIBRARIES} ${LIBFLAC_LIBRARIES} ${MPG123_LIBRARIES} ${DUMB_LIBRARIES} ${GST_LIBRARIES} ${EXTRA_LIBS})
439 FIND_PROGRAM(NATDOCS_BIN NaturalDocs)
440 IF(NATDOCS_BIN)
441     ADD_CUSTOM_TARGET(docs
442                       "${NATDOCS_BIN}" -i "${ALURE_SOURCE_DIR}/src" -o HTML "${ALURE_SOURCE_DIR}/docs/html" -p "${ALURE_SOURCE_DIR}/docs/naturaldocs" -s Default CustomStyle
443                       COMMENT "Building NaturalDocs documentation..." VERBATIM)
444 ELSE(NATDOCS_BIN)
445     MESSAGE(STATUS "\nNaturalDocs not found; building documentation is disabled")
446 ENDIF(NATDOCS_BIN)
449 #add an install target here
450 IF(APPLE)
451     SET(INCPATH OpenAL)
452 ELSE(APPLE)
453     SET(INCPATH AL)
454 ENDIF(APPLE)
456 INSTALL(DIRECTORY "${ALURE_SOURCE_DIR}/docs/html"
457         DESTINATION share/doc/alure
459 INSTALL(TARGETS ${LIBNAME}
460         RUNTIME DESTINATION bin
461         LIBRARY DESTINATION ${LIB_INSTALL_DIR}
462         ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
464 INSTALL(FILES include/AL/alure.h
465         DESTINATION "include/${INCPATH}"
467 INSTALL(FILES "${ALURE_BINARY_DIR}/alure.pc"
468         DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
472 MESSAGE(STATUS "\n********************** Configured options **********************")
473 IF(NO_SHARED)
474     MESSAGE(STATUS "Building static library")
475 ELSE(NO_SHARED)
476     MESSAGE(STATUS "Building shared library")
477 ENDIF(NO_SHARED)
478 MESSAGE(STATUS "")
479 IF(HAS_SNDFILE)
480     MESSAGE(STATUS "SndFile support: enabled")
481 ELSE(HAS_SNDFILE)
482     MESSAGE(STATUS "SndFile support: disabled")
483 ENDIF(HAS_SNDFILE)
484 IF(HAS_VORBISFILE)
485     MESSAGE(STATUS "VorbisFile support: enabled")
486 ELSE(HAS_VORBISFILE)
487     MESSAGE(STATUS "VorbisFile support: disabled")
488 ENDIF(HAS_VORBISFILE)
489 IF(HAS_FLAC)
490     MESSAGE(STATUS "FLAC support: enabled")
491 ELSE(HAS_FLAC)
492     MESSAGE(STATUS "FLAC support: disabled")
493 ENDIF(HAS_FLAC)
494 IF(HAS_MPG123)
495     MESSAGE(STATUS "MPG123 support: enabled")
496 ELSE(HAS_MPG123)
497     MESSAGE(STATUS "MPG123 support: disabled")
498 ENDIF(HAS_MPG123)
499 IF(HAS_DUMB)
500     MESSAGE(STATUS "DUMB support: enabled")
501 ELSE(HAS_DUMB)
502     MESSAGE(STATUS "DUMB support: disabled")
503 ENDIF(HAS_DUMB)
504 IF(HAS_TIMIDITY)
505     MESSAGE(STATUS "Timidity support: enabled")
506 ELSE(HAS_TIMIDTY)
507     MESSAGE(STATUS "Timidity support: disabled")
508 ENDIF(HAS_TIMIDITY)
509 IF(HAS_GSTREAMER)
510     MESSAGE(STATUS "GStreamer support: enabled")
511 ELSE(HAS_GSTREAMER)
512     MESSAGE(STATUS "GStreamer support: disabled")
513 ENDIF(HAS_GSTREAMER)
514 MESSAGE(STATUS "")