Add a MIDI "decoder" using Timidity
[alure.git] / CMakeLists.txt
blob11d45df4776906a876cf20f746a8083193289efa
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)
93 ENDIF(MSVC)
96 CHECK_INCLUDE_FILE(windows.h HAVE_WINDOWS_H -D_WIN32_WINNT=0x0500)
97 IF(NOT HAVE_WINDOWS_H)
98     CHECK_C_COMPILER_FLAG(-pthread HAVE_PTHREAD)
99     IF(HAVE_PTHREAD)
100         ADD_DEFINITIONS(-pthread)
101         SET(EXTRA_LIBS ${EXTRA_LIBS} -pthread)
102     ENDIF(HAVE_PTHREAD)
104     # We need pthreads outside of Windows
105     CHECK_INCLUDE_FILE(pthread.h HAVE_PTHREAD_H)
106     IF(NOT HAVE_PTHREAD_H)
107         MESSAGE(FATAL_ERROR "PThreads is required for non-Windows builds!")
108     ENDIF()
109     # Some systems need pthread_np.h to get recursive mutexes
110     CHECK_INCLUDE_FILES("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H)
112     # _GNU_SOURCE is needed on some systems for extra attributes, and
113     # _REENTRANT is needed for libc thread-safety
114     ADD_DEFINITIONS(-D_GNU_SOURCE=1)
115     CHECK_FUNCTION_EXISTS(pthread_create HAS_PTHREAD_CREATE)
116     IF(NOT HAS_PTHREAD_CREATE)
117         CHECK_SHARED_LIBRARY_EXISTS(pthread pthread_create "" HAVE_LIBPTHREAD)
118         IF(NOT HAVE_LIBPTHREAD)
119             MESSAGE(FATAL_ERROR "pthread_create not found on non-Windows target!")
120         ENDIF(NOT HAVE_LIBPTHREAD)
121         SET(EXTRA_LIBS pthread ${EXTRA_LIBS})
122     ENDIF(NOT HAS_PTHREAD_CREATE)
124     CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
125     IF(NOT HAVE_NANOSLEEP)
126         MESSAGE(FATAL_ERROR "No sleep function found!")
127     ENDIF(NOT HAVE_NANOSLEEP)
128 ENDIF(NOT HAVE_WINDOWS_H)
130 CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
131 CHECK_INCLUDE_FILE(sys/wait.h HAVE_SYS_WAIT_H)
132 CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H)
135 OPTION(SNDFILE   "SoundFile support (for various formats)" ON)
136 OPTION(VORBIS    "VorbisFile support (for Ogg Vorbis)"  ON)
137 OPTION(FLAC      "FLAC support (for FLAC and Ogg FLAC)" ON)
138 OPTION(MPG123    "MPG123 support (for MP1/MP2/MP3)" ON)
139 OPTION(DUMB      "DUMB support (for IT/XM/S3M/MOD)" ON)
140 OPTION(TIMIDITY  "Timidity support (for MIDI)" ON)
141 OPTION(GSTREAMER "GStreamer support" OFF)
143 IF(WIN32)
144     ADD_DEFINITIONS(-D_WIN32)
146     IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
147         SET(WIN_TYPE Win64)
148         SET(XBITS x64)
149     ELSE(CMAKE_SIZEOF_VOID_P MATCHES "8")
150         SET(WIN_TYPE Win32)
151         SET(XBITS x86)
152     ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
154     SET(OPENAL_SEARCH_PATHS
155         ENV ALSDK_DIR
156         ENV MINGDIR
157         "C:/Program Files/OpenAL 1.1 SDK"
158         "C:/Program Files (x86)/OpenAL 1.1 SDK"
159         "E:/Programs/Dev/OpenAL"
160         "E:/Program Files (x86)/OpenAL 1.1 SDK" )
162     FIND_PATH(OPENAL_INCLUDE_DIR al.h
163               PATHS ${OPENAL_SEARCH_PATHS}
164               PATH_SUFFIXES include include/AL )
165     IF(OPENAL_INCLUDE_DIR)
166         INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR})
167         FIND_LIBRARY(OPENAL_LIBRARIES OpenAL32
168                      PATHS ${OPENAL_SEARCH_PATHS}
169                      PATH_SUFFIXES lib libs/${WIN_TYPE} )
170     ENDIF(OPENAL_INCLUDE_DIR)
172     IF(NOT OPENAL_LIBRARIES)
173         MESSAGE(FATAL_ERROR "OpenAL not found!\nPlease try setting the ALSDK_DIR environment variable and try again.")
174     ENDIF(NOT OPENAL_LIBRARIES)
176     MESSAGE(STATUS "OpenAL include: ${OPENAL_INCLUDE_DIR}")
177     MESSAGE(STATUS "OpenAL lib: ${OPENAL_LIBRARIES}")
178 ELSE(WIN32)
179     PKG_CHECK_MODULES(OPENAL openal)
180     IF(NOT OPENAL_FOUND)
181         IF(APPLE)
182             CHECK_INCLUDE_FILE(OpenAL/al.h HAVE_OPENAL_AL_H)
183             IF(HAVE_OPENAL_AL_H)
184                 SET(OPENAL_LIBRARIES "-framework OpenAL")
185                 SET(HAS_OPENAL 1)
186             ENDIF(HAVE_OPENAL_AL_H)
187         ELSE(APPLE)
188             CHECK_INCLUDE_FILE(AL/al.h HAVE_AL_AL_H)
189             IF(HAVE_AL_AL_H)
190                 CHECK_SHARED_LIBRARY_EXISTS(openal alcOpenDevice "" HAS_OPENAL)
191                 IF(HAS_OPENAL)
192                     SET(OPENAL_LIBRARIES openal)
193                 ENDIF(HAS_OPENAL)
194             ENDIF(HAVE_AL_AL_H)
195         ENDIF(APPLE)
196         IF(NOT HAS_OPENAL)
197             MESSAGE(FATAL_ERROR "OpenAL not found!")
198         ENDIF(NOT HAS_OPENAL)
199     ELSE(NOT OPENAL_FOUND)
200         INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIRS})
201         LINK_DIRECTORIES(${OPENAL_LIBRARY_DIRS})
202     ENDIF(NOT OPENAL_FOUND)
203 ENDIF(WIN32)
205 # SndFile support
206 IF(SNDFILE)
207     PKG_CHECK_MODULES(SNDFILE sndfile)
208     IF(NOT SNDFILE_FOUND)
209         CHECK_INCLUDE_FILE(sndfile.h HAVE_SNDFILE_H)
210         IF(HAVE_SNDFILE_H)
211             CHECK_SHARED_LIBRARY_EXISTS(sndfile sf_open "" HAS_SNDFILE)
212             IF(HAS_SNDFILE)
213                 SET(SNDFILE_LIBRARIES "sndfile")
214             ELSE(HAS_SNDFILE)
215                 CHECK_SHARED_LIBRARY_EXISTS(libsndfile-1 sf_open "" HAS_LIBSNDFILE1)
216                 IF(HAS_LIBSNDFILE1)
217                     SET(HAS_SNDFILE 1)
218                     SET(SNDFILE_LIBRARIES "libsndfile-1")
219                 ENDIF(HAS_LIBSNDFILE1)
220             ENDIF(HAS_SNDFILE)
221         ENDIF(HAVE_SNDFILE_H)
222     ELSE(NOT SNDFILE_FOUND)
223         SET(HAS_SNDFILE 1)
224         INCLUDE_DIRECTORIES(${SNDFILE_INCLUDE_DIRS})
225         LINK_DIRECTORIES(${SNDFILE_LIBRARY_DIRS})
226     ENDIF(NOT SNDFILE_FOUND)
227 ELSE(SNDFILE)
228     SET(SNDFILE_LIBRARIES "")
229 ENDIF(SNDFILE)
231 # Vorbis support
232 IF(VORBIS)
233     PKG_CHECK_MODULES(VORBISFILE vorbisfile)
234     IF(NOT VORBISFILE_FOUND)
235         CHECK_INCLUDE_FILE(vorbis/vorbisfile.h HAVE_VORBIS_VORBISFILE_H)
236         IF(HAVE_VORBIS_VORBISFILE_H)
237             CHECK_SHARED_LIBRARY_EXISTS(vorbisfile ov_open "" HAS_VORBISFILE)
238             IF(HAS_VORBISFILE)
239                 SET(VORBISFILE_LIBRARIES "vorbisfile")
240             ENDIF(HAS_VORBISFILE)
241         ENDIF(HAVE_VORBIS_VORBISFILE_H)
242     ELSE(NOT VORBISFILE_FOUND)
243         SET(HAS_VORBISFILE 1)
244         INCLUDE_DIRECTORIES(${VORBISFILE_INCLUDE_DIRS})
245         LINK_DIRECTORIES(${VORBISFILE_LIBRARY_DIRS})
246     ENDIF(NOT VORBISFILE_FOUND)
247 ELSE(VORBIS)
248     SET(VORBISFILE_LIBRARIES "")
249 ENDIF(VORBIS)
251 # FLAC support
252 IF(FLAC)
253     #PKG_CHECK_MODULES(LIBFLAC flac)
254     #IF(NOT LIBFLAC_FOUND)
255         CHECK_INCLUDE_FILE(FLAC/all.h HAVE_FLAC_ALL_H)
256         IF(HAVE_FLAC_ALL_H)
257             CHECK_SHARED_LIBRARY_EXISTS(FLAC FLAC__stream_decoder_new "" HAS_FLAC)
258             IF(HAS_FLAC)
259                 SET(LIBFLAC_LIBRARIES "FLAC")
260             ENDIF(HAS_FLAC)
261         ENDIF(HAVE_FLAC_ALL_H)
262     #ELSE(NOT LIBFLAC)
263     #    SET(HAS_FLAC 1)
264     #    INCLUDE_DIRECTORIES(${LIBFLAC_INCLUDE_DIRS})
265     #    LINK_DIRECTORIES(${LIBFLAC_LIBRARY_DIRS})
266     #ENDIF(NOT LIBFLAC_FOUND)
267 ELSE(FLAC)
268     SET(LIBFLAC_LIBRARIES "")
269 ENDIF(FLAC)
271 # MPG123 support
272 IF(MPG123)
273     PKG_CHECK_MODULES(MPG123 libmpg123)
274     IF(NOT MPG123_FOUND)
275         CHECK_INCLUDE_FILE(mpg123.h HAVE_MPG123_H)
276         IF(HAVE_MPG123_H)
277             CHECK_SHARED_LIBRARY_EXISTS(mpg123 mpg123_init "" HAS_MPG123)
278             IF(HAS_MPG123)
279                 SET(MPG123_LIBRARIES "mpg123")
280             ENDIF(HAS_MPG123)
281         ENDIF(HAVE_MPG123_H)
282     ELSE(NOT MPG123_FOUND)
283         SET(HAS_MPG123 1)
284         INCLUDE_DIRECTORIES(${MPG123_INCLUDE_DIRS})
285         LINK_DIRECTORIES(${MPG123_LIBRARY_DIRS})
286     ENDIF(NOT MPG123_FOUND)
287 ELSE(MPG123)
288     SET(MPG123_LIBRARIES "")
289 ENDIF(MPG123)
291 # DUMB support
292 IF(DUMB)
293     CHECK_INCLUDE_FILE(dumb.h HAVE_DUMB_H)
294     IF(HAVE_DUMB_H)
295         IF(HAS_LIBM)
296             CHECK_SHARED_LIBRARY_EXISTS("dumb;m" dumbfile_open_ex "" HAS_DUMB)
297         ELSE(HAS_LIBM)
298             CHECK_SHARED_LIBRARY_EXISTS(dumb dumbfile_open_ex "" HAS_DUMB)
299         ENDIF(HAS_LIBM)
300         IF(HAS_DUMB)
301             SET(DUMB_LIBRARIES dumb)
302         ENDIF(HAS_DUMB)
303     ENDIF(HAVE_DUMB_H)
304 ELSE(DUMB)
305     SET(DUMB_LIBRARIES "")
306 ENDIF(DUMB)
308 IF(TIMIDITY)
309     CHECK_FUNCTION_EXISTS(fork HAVE_FORK)
310     CHECK_FUNCTION_EXISTS(pipe HAVE_PIPE)
311     CHECK_FUNCTION_EXISTS(kill HAVE_KILL)
312     CHECK_FUNCTION_EXISTS(open HAVE_OPEN)
313     IF(HAVE_OPEN AND HAVE_KILL AND HAVE_PIPE AND HAVE_FORK)
314         SET(HAS_TIMIDITY 1)
315     ELSE(HAVE_OPEN AND HAVE_KILL AND HAVE_PIPE AND HAVE_FORK)
316         SET(HAS_TIMIDITY 0)
317     ENDIF(HAVE_OPEN AND HAVE_KILL AND HAVE_PIPE AND HAVE_FORK)
318 ENDIF(TIMIDITY)
320 # GStreamer support
321 IF(GSTREAMER)
322     PKG_CHECK_MODULES(GST gstreamer-0.10;gstreamer-plugins-base-0.10)
323     IF(GST_FOUND)
324         CHECK_SHARED_LIBRARY_EXISTS(gstapp-0.10 gst_app_sink_pull_buffer "" HAS_GSTAPP)
325         IF(HAS_GSTAPP)
326             SET(HAS_GSTREAMER 1)
327             INCLUDE_DIRECTORIES(${GST_INCLUDE_DIRS})
328             LINK_DIRECTORIES(${GST_LIBRARY_DIRS})
329             SET(EXTRA_LIBS gstapp-0.10 ${EXTRA_LIBS})
330         ENDIF(HAS_GSTAPP)
331     ELSE(GST_FOUND)
332         SET(GST_SEARCH_PATHS
333             ENV GSTSDK_DIR
334             ENV MINGDIR
335             "C:/Program Files/gstreamer"
336             "C:/gstreamer" )
338         MESSAGE(STATUS "Looking for glib.h")
339         FIND_PATH(GLIB_INCLUDE_DIR glib.h
340                   PATHS ${GST_SEARCH_PATHS}
341                   PATH_SUFFIXES include include/glib-2.0)
342         IF(GLIB_INCLUDE_DIR)
343             MESSAGE(STATUS "Looking for glib.h - found: ${GLIB_INCLUDE_DIR}")
344         ELSE(GLIB_INCLUDE_DIR)
345             MESSAGE(STATUS "Looking for glib.h - not found")
346         ENDIF(GLIB_INCLUDE_DIR)
348         MESSAGE(STATUS "Looking for gst/gst.h")
349         FIND_PATH(GST_INCLUDE_DIR gst/gst.h
350                   PATHS ${GST_SEARCH_PATHS}
351                   PATH_SUFFIXES include include/gstreamer-0.10)
352         IF(GST_INCLUDE_DIR)
353             MESSAGE(STATUS "Looking for gst/gst.h - found: ${GST_INCLUDE_DIR}")
354         ELSE(GST_INCLUDE_DIR)
355             MESSAGE(STATUS "Looking for gst/gst.h - not found")
356         ENDIF(GST_INCLUDE_DIR)
358         IF(GLIB_INCLUDE_DIR AND GST_INCLUDE_DIR)
359             INCLUDE_DIRECTORIES("${GLIB_INCLUDE_DIR}" "${GST_INCLUDE_DIR}")
360             FIND_LIBRARY(GST_LIBRARY1 NAMES gstapp-0.10
361                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
362             FIND_LIBRARY(GST_LIBRARY2 NAMES gstreamer-0.10
363                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
364             FIND_LIBRARY(GST_LIBRARY3 NAMES gthread-2.0
365                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
366             FIND_LIBRARY(GST_LIBRARY4 NAMES gmodule-2.0
367                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
368             FIND_LIBRARY(GST_LIBRARY5 NAMES gobject-2.0
369                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
370             FIND_LIBRARY(GST_LIBRARY6 NAMES glib-2.0
371                          PATHS ${GST_SEARCH_PATHS} PATH_SUFFIXES lib )
372             IF(GST_LIBRARY1 AND GST_LIBRARY2 AND GST_LIBRARY3 AND GST_LIBRARY4 AND GST_LIBRARY5 AND GST_LIBRARY6)
373                 SET(GST_LIBRARIES "${GST_LIBRARY1}" "${GST_LIBRARY2}" "${GST_LIBRARY3}" "${GST_LIBRARY4}" "${GST_LIBRARY5}" "${GST_LIBRARY6}")
374                 MESSAGE(STATUS "GStreamer libs: ${GST_LIBRARIES}")
375                 SET(HAS_GSTREAMER 1)
376             ENDIF(GST_LIBRARY1 AND GST_LIBRARY2 AND GST_LIBRARY3 AND GST_LIBRARY4 AND GST_LIBRARY5 AND GST_LIBRARY6)
377         ENDIF(GLIB_INCLUDE_DIR AND GST_INCLUDE_DIR)
378     ENDIF(GST_FOUND)
379 ELSE(GSTREAMER)
380     SET(GST_LIBRARIES "")
381 ENDIF(GSTREAMER)
384 # For alure.pc.in
385 SET(prefix ${CMAKE_INSTALL_PREFIX})
386 SET(exec_prefix "\${prefix}")
387 SET(libdir "\${exec_prefix}/${LIB_INSTALL_DIR}")
388 SET(bindir "\${exec_prefix}/bin")
389 SET(includedir "\${prefix}/include")
390 SET(PKG_CONFIG_REQUIRES openal)
391 SET(PACKAGE_VERSION "${LIB_VERSION}")
393 # End configuration
394 CONFIGURE_FILE(
395     "${ALURE_SOURCE_DIR}/config.h.in"
396     "${ALURE_BINARY_DIR}/config.h")
397 CONFIGURE_FILE(
398     "${ALURE_SOURCE_DIR}/alure.pc.in"
399     "${ALURE_BINARY_DIR}/alure.pc"
400     @ONLY)
403 SET(ALURE_OBJS  src/alure.cpp
404                 src/buffer.cpp
405                 src/istream.cpp
406                 src/stream.cpp
407                 src/streamplay.cpp
410 IF(NOT NO_SHARED)
411     #build a shared library
412     ADD_LIBRARY(${LIBNAME} SHARED ${ALURE_OBJS})
413     SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES VERSION ${LIB_VERSION}
414                                                 SOVERSION ${LIB_MAJOR_VERSION})
415     IF(WIN32)
416         SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES PREFIX "")
417     ENDIF(WIN32)
418     TARGET_LINK_LIBRARIES(${LIBNAME} ${OPENAL_LIBRARIES} ${SNDFILE_LIBRARIES} ${VORBISFILE_LIBRARIES} ${LIBFLAC_LIBRARIES} ${MPG123_LIBRARIES} ${DUMB_LIBRARIES} ${GST_LIBRARIES} ${EXTRA_LIBS})
419 ELSE(NOT NO_SHARED)
420     #build a static library
421     ADD_LIBRARY(${LIBNAME} STATIC ${ALURE_OBJS})
422     SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES VERSION ${LIB_VERSION})
423 ENDIF(NOT NO_SHARED)
426 ADD_EXECUTABLE(alureplay examples/alureplay.c)
427 TARGET_LINK_LIBRARIES(alureplay ${LIBNAME} ${OPENAL_LIBRARIES} ${SNDFILE_LIBRARIES} ${VORBISFILE_LIBRARIES} ${LIBFLAC_LIBRARIES} ${MPG123_LIBRARIES} ${GST_LIBRARIES} ${EXTRA_LIBS})
429 ADD_EXECUTABLE(alurestream examples/alurestream.c)
430 TARGET_LINK_LIBRARIES(alurestream ${LIBNAME} ${OPENAL_LIBRARIES} ${SNDFILE_LIBRARIES} ${VORBISFILE_LIBRARIES} ${LIBFLAC_LIBRARIES} ${MPG123_LIBRARIES} ${GST_LIBRARIES} ${EXTRA_LIBS})
433 FIND_PROGRAM(NATDOCS_BIN NaturalDocs)
434 IF(NATDOCS_BIN)
435     ADD_CUSTOM_TARGET(docs
436                       "${NATDOCS_BIN}" -i "${ALURE_SOURCE_DIR}/src" -o HTML "${ALURE_SOURCE_DIR}/docs/html" -p "${ALURE_SOURCE_DIR}/docs/naturaldocs" -s Default CustomStyle
437                       COMMENT "Building NaturalDocs documentation..." VERBATIM)
438 ELSE(NATDOCS_BIN)
439     MESSAGE(STATUS "\nNaturalDocs not found; building documentation is disabled")
440 ENDIF(NATDOCS_BIN)
443 #add an install target here
444 IF(APPLE)
445     SET(INCPATH OpenAL)
446 ELSE(APPLE)
447     SET(INCPATH AL)
448 ENDIF(APPLE)
450 INSTALL(DIRECTORY "${ALURE_SOURCE_DIR}/docs/html"
451         DESTINATION share/doc/alure
453 INSTALL(TARGETS ${LIBNAME}
454         RUNTIME DESTINATION bin
455         LIBRARY DESTINATION ${LIB_INSTALL_DIR}
456         ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
458 INSTALL(FILES include/AL/alure.h
459         DESTINATION "include/${INCPATH}"
461 INSTALL(FILES "${ALURE_BINARY_DIR}/alure.pc"
462         DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
466 MESSAGE(STATUS "\n********************** Configured options **********************")
467 IF(NO_SHARED)
468     MESSAGE(STATUS "Building static library")
469 ELSE(NO_SHARED)
470     MESSAGE(STATUS "Building shared library")
471 ENDIF(NO_SHARED)
472 MESSAGE(STATUS "")
473 IF(HAS_SNDFILE)
474     MESSAGE(STATUS "SndFile support: enabled")
475 ELSE(HAS_SNDFILE)
476     MESSAGE(STATUS "SndFile support: disabled")
477 ENDIF(HAS_SNDFILE)
478 IF(HAS_VORBISFILE)
479     MESSAGE(STATUS "VorbisFile support: enabled")
480 ELSE(HAS_VORBISFILE)
481     MESSAGE(STATUS "VorbisFile support: disabled")
482 ENDIF(HAS_VORBISFILE)
483 IF(HAS_FLAC)
484     MESSAGE(STATUS "FLAC support: enabled")
485 ELSE(HAS_FLAC)
486     MESSAGE(STATUS "FLAC support: disabled")
487 ENDIF(HAS_FLAC)
488 IF(HAS_MPG123)
489     MESSAGE(STATUS "MPG123 support: enabled")
490 ELSE(HAS_MPG123)
491     MESSAGE(STATUS "MPG123 support: disabled")
492 ENDIF(HAS_MPG123)
493 IF(HAS_DUMB)
494     MESSAGE(STATUS "DUMB support: enabled")
495 ELSE(HAS_DUMB)
496     MESSAGE(STATUS "DUMB support: disabled")
497 ENDIF(HAS_DUMB)
498 IF(HAS_TIMIDITY)
499     MESSAGE(STATUS "Timidity support: enabled")
500 ELSE(HAS_TIMIDTY)
501     MESSAGE(STATUS "Timidity support: disabled")
502 ENDIF(HAS_TIMIDITY)
503 IF(HAS_GSTREAMER)
504     MESSAGE(STATUS "GStreamer support: enabled")
505 ELSE(HAS_GSTREAMER)
506     MESSAGE(STATUS "GStreamer support: disabled")
507 ENDIF(HAS_GSTREAMER)
508 MESSAGE(STATUS "")