# http://TODO.com/osgaudio-master.zip

### DEPENDS ###
DKDEPEND(openscenegraph)
DKDEPEND(libogg)
DKDEPEND(libvorbis)
DKDEPEND(freealut)
DKDEPEND(openal-android)
DKDEPEND(freealut)
DKDEPEND(openal)


### VERSION ###
${OSGAUDIO_VERSION master}
${OSGAUDIO_NAME osgaudio-${OSG_VERSION}}

${OSGAUDIO_DL http://TODO.com/${OSGAUDIO_NAME}.zip}
${OSGAUDIO ${3RDPARTY}/${OSG_NAME})
DKSET(OSGAUDIO ${3RDPARTY}/osgaudio-master)


### INSTALL ###
DKINSTALL(${OSG_AUDIODL} osgaudio-master ${OSGAUDIO})



### LINK ###
DKINCLUDE(${OSGAUDIO}/include)
WIN_DEBUG_LIB(${OSGAUDIO}/${OS}/lib/${DEBUG_DIR}/openalppd.lib)
WIN_RELEASE_LIB(${OSGAUDIO}/${OS}/lib/${RELEASE_DIR}/openalpp.lib)
APPLE_DEBUG_LIB(${OSGAUDIO}/${OS}/lib/${DEBUG}/libopenalppd.a)
APPLE_RELEASE_LIB(${OSGAUDIO}/${OS}/lib/${RELEASE}/libopenalpp.a)
LINUX_DEBUG_LIB(${OSGAUDIO}/${OS}/${DEBUG_DIR}/lib/libopenalppd.a)
LINUX_RELEASE_LIB(${OSGAUDIO}/${OS}/${RELEASE_DIR}/lib/libopenalpp.a)
ANDROID_DEBUG_LIB(${OSGAUDIO}/${OS}/${DEBUG_DIR}/obj/local/armeabi-v7a/libopenalpp.a)
ANDROID_RELEASE_LIB(${OSGAUDIO}/${OS}/${RELEASE_DIR}/obj/local/armeabi-v7a/libopenalpp.a)

WIN_DEBUG_LIB(${OSGAUDIO}/${OS}/lib/${DEBUG_DIR}/osgAudiod.lib)
WIN_RELEASE_LIB(${OSGAUDIO}/${OS}/lib/${RELEASE_DIR}/osgAudio.lib)
APPLE_DEBUG_LIB(${OSGAUDIO}/${OS}/lib/${DEBUG}/libosgAudiod.a)
APPLE_RELEASE_LIB(${OSGAUDIO}/${OS}/lib/${RELEASE}/libosgAudio.a)
LINUX_DEBUG_LIB(${OSGAUDIO}/${OS}/${DEBUG_DIR}/lib/libosgAudiod.a)
LINUX_RELEASE_LIB(${OSGAUDIO}/${OS}/${RELEASE_DIR}/lib/libosgAudio.a)
ANDROID_DEBUG_LIB(${OSGAUDIO}/${OS}/${DEBUG_DIR}/obj/local/armeabi-v7a/libosgAudio.a)
ANDROID_RELEASE_LIB(${OSGAUDIO}/${OS}/${RELEASE_DIR}/obj/local/armeabi-v7a/libosgAudio.a)

WIN_DEBUG_LIB(${OSGAUDIO}/${OS}/lib/${DEBUG_DIR}/osgdb_osgAudiod.lib)
WIN_RELEASE_LIB(${OSGAUDIO}/${OS}/lib/${RELEASE_DIR}/osgdb_osgAudio.lib)
APPLE_DEBUG_LIB(${OSGAUDIO}/${OS}/lib/${DEBUG}/libosgdb_osgAudiod.a)
APPLE_RELEASE_LIB(${OSGAUDIO}/${OS}/lib/${RELEASE}/libosgdb_osgAudio.a)
LINUX_DEBUG_LIB(${OSGAUDIO}/${OS}/${DEBUG_DIR}/lib/libosgdb_osgAudiod.a)
LINUX_RELEASE_LIB(${OSGAUDIO}/${OS}/${RELEASE_DIR}/lib/libosgdb_osgAudio.a)
ANDROID_DEBUG_LIB(${OSGAUDIO}/${OS}/${DEBUG_DIR}/obj/local/armeabi-v7a/libosgdb_osgAudio.a)
ANDROID_RELEASE_LIB(${OSGAUDIO}/${OS}/${RELEASE_DIR}/obj/local/armeabi-v7a/libosgdb_osgAudio.a)


### COMPILE ###
DKSETPATH(${OSGAUDIO}/${OS})
WIN32_COMMAND(${CMAKE_EXE} -G ${GENERATOR} "-DCMAKE_CXX_FLAGS=/DWIN32 /D_WINDOWS /W3 /nologo /GR /EHsc /DOSG_LIBRARY_STATIC /DAL_LIBTYPE_STATIC /I${OPENAL}/include" "-DCMAKE_CXX_FLAGS_DEBUG=/MTd /Od /Ob0 /Zi /RTC1 /DDEBUG /D_DEBUG" "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Ob2 /DNDEBUG" "-DOSGInstallType=Source And Build Tree" -DOSGBuildRoot=${OSG}/${OS} -DOSGSourceRoot=${OSG} -DALUT_INCLUDE_DIR=${FREEALUT}/include -DALUT_LIBRARY=${FREEALUT}/${OS}/${RELEASE_DIR}/alut_static.lib -DALUT_LIBRARY_DEBUG=${FREEALUT}/${OS}/${DEBUG_DIR}/alut_static.lib -D0_BUILD_EXAMPLES_OALPP=OFF -D0_BUILD_EXAMPLES_OSGAUDIO=OFF -D0_BUILD_EXAMPLES_OSGAUDIO_LOWLEVEL=OFF -D0_ENABLE_SUBSYSTEM_OPENAL=ON -D0_ENABLE_SUBSYSTEM_FMOD=OFF -DFMOD_INCLUDE_DIR=OFF -DFMOD_LIBRARY=OFF -DOSGAUDIO_INSTALL_DATA=OFF -DOPENAL_INCLUDE_DIR=${OPENAL}/include/AL -DOPENAL_LIBRARY=${OPENAL}/${OS}/${RELEASE_DIR}/OpenAL32.lib -DOGG_INCLUDE_DIR=${OGG}/include -DOGG_LIBRARY=${OGG}/${OS}/${RELEASE_DIR}/src/.libs/libogg.lib -DOGG_LIBRARY_DEBUG=${OGG}/${OS}/${DEBUG_DIR}/src/.libs/libogg.lib -DVORBIS_INCLUDE_DIR=${VORBIS}/include -DVORBIS_LIBRARY=${VORBIS}/${OS}/${RELEASE_DIR}/lib/.libs/libvorbis.lib -DVORBIS_LIBRARY_DEBUG=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbis.lib -DVORBISFILE_INCLUDE_DIR=${VORBIS}/include -DVORBISFILE_LIBRARY=${VORBIS}/${OS}/${RELEASE_DIR}/lib/.libs/libvorbisfile.lib -DVORBISFILE_LIBRARY_DEBUG=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbisfile.lib ${OSGAUDIO})
WIN32_VS_DEBUG(osgaudio-master osgAudio.sln)
WIN32_VS_RELEASE(osgaudio-master osgAudio.sln)

DKSETPATH(${OSGAUDIO}/${OS})
WIN64_COMMAND(${CMAKE_EXE} -G ${X64GENERATOR} "-DCMAKE_CXX_FLAGS=/DWIN32 /D_WINDOWS /W3 /nologo /GR /EHsc /DOSG_LIBRARY_STATIC /DAL_LIBTYPE_STATIC /I${OPENAL}/include" "-DCMAKE_CXX_FLAGS_DEBUG=/MTd /Od /Ob0 /Zi /RTC1 /DDEBUG /D_DEBUG" "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Ob2 /DNDEBUG" "-DOSGInstallType=Source And Build Tree" -DOSGBuildRoot=${OSG}/${OS} -DOSGSourceRoot=${OSG} -DALUT_INCLUDE_DIR=${FREEALUT}/include -DALUT_LIBRARY=${FREEALUT}/${OS}/${RELEASE_DIR}/alut_static.lib -DALUT_LIBRARY_DEBUG=${FREEALUT}/${OS}/${DEBUG_DIR}/alut_static.lib -D0_BUILD_EXAMPLES_OALPP=OFF -D0_BUILD_EXAMPLES_OSGAUDIO=OFF -D0_BUILD_EXAMPLES_OSGAUDIO_LOWLEVEL=OFF -D0_ENABLE_SUBSYSTEM_OPENAL=ON -D0_ENABLE_SUBSYSTEM_FMOD=OFF -DFMOD_INCLUDE_DIR=OFF -DFMOD_LIBRARY=OFF -DOSGAUDIO_INSTALL_DATA=OFF -DOPENAL_INCLUDE_DIR=${OPENAL}/include/AL -DOPENAL_LIBRARY=${OPENAL}/${OS}/${RELEASE_DIR}/OpenAL32.lib -DOGG_INCLUDE_DIR=${OGG}/include -DOGG_LIBRARY=${OGG}/${OS}/${RELEASE_DIR}/src/.libs/libogg.lib -DOGG_LIBRARY_DEBUG=${OGG}/${OS}/${DEBUG_DIR}/src/.libs/libogg.lib -DVORBIS_INCLUDE_DIR=${VORBIS}/include -DVORBIS_LIBRARY=${VORBIS}/${OS}/${RELEASE_DIR}/lib/.libs/libvorbis.lib -DVORBIS_LIBRARY_DEBUG=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbis.lib -DVORBISFILE_INCLUDE_DIR=${VORBIS}/include -DVORBISFILE_LIBRARY=${VORBIS}/${OS}/${RELEASE_DIR}/lib/.libs/libvorbisfile.lib -DVORBISFILE_LIBRARY_DEBUG=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbisfile.lib ${OSGAUDIO})
WIN64_VS_DEBUG(osgaudio-master osgAudio.sln)
WIN64_VS_RELEASE(osgaudio-master osgAudio.sln)

DKSETPATH(${OSGAUDIO}/${OS})
MAC_COMMAND(${CMAKE_EXE} -G "Xcode" -DCMAKE_OSX_ARCHITECTURES=x86_64 "-DCMAKE_CXX_FLAGS=-I${OPENAL}/include -I${FREEALUT}/include" "-DOSGInstallType=Source And Build Tree" -DOSGBuildRoot=${OSG}/${OS} -DOSGSourceRoot=${OSG} -DALUT_INCLUDE_DIR=${OSG}/include -DALUT_LIBRARY=${FREEALUT}/${OS}/${RELEASE_DIR}/libalut_static.a -DALUT_LIBRARY_DEBUG=${FREEALUT}/${OS}/${DEBUG_DIR}/libalut_static.a -D0_BUILD_EXAMPLES_OALPP=OFF -D0_BUILD_EXAMPLES_OSGAUDIO=OFF -D0_BUILD_EXAMPLES_OSGAUDIO_LOWLEVEL=OFF -D0_ENABLE_SUBSYSTEM_OPENAL=ON -D0_ENABLE_SUBSYSTEM_FMOD=OFF -DFMOD_INCLUDE_DIR=OFF -DFMOD_LIBRARY=OFF -DOSGAUDIO_INSTALL_DATA=OFF -DOPENAL_INCLUDE_DIR=${OPENAL}/include/AL -DOPENAL_LIBRARY=${OPENAL}/${OS}/${RELEASE_DIR}/libopenal.a -DOGG_INCLUDE_DIR=${OGG}/include -DOGG_LIBRARY=${OGG}/${OS}/${RELEASE_DIR}/src/.libs/libogg.a -DOGG_LIBRARY_DEBUG=${OGG}/${OS}/${DEBUG_DIR}/src/.libs/libogg.a -DVORBIS_INCLUDE_DIR=${VORBIS}/include -DVORBIS_LIBRARY=${VORBIS}/${OS}/${RELEASE_DIR}/lib/.libs/libvorbis.a -DVORBIS_LIBRARY_DEBUG=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbis.a -DVORBISFILE_INCLUDE_DIR=${VORBIS}/include -DVORBISFILE_LIBRARY=${VORBIS}/${OS}/${RELEASE_DIR}/lib/.libs/libvorbisfile.a -DVORBISFILE_LIBRARY_DEBUG=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbisfile.a ${OSGAUDIO})
MAC_XCODE_DEBUG(osgaudio-master)
MAC_XCODE_RELEASE(osgaudio-master)


DKSETPATH(${OSGAUDIO}/${OS}/${DEBUG_DIR})
LINUX_DEBUG_COMMAND(${CMAKE_EXE} -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_C_FLAGS=-fPIC "-DCMAKE_CXX_FLAGS=-I${OPENAL}/include -I${FREEALUT}/include" "-DOSGInstallType=Source And Build Tree" -DOSGBuildRoot=${OSG}/${OS}/${DEBUG_DIR} -DOSGSourceRoot=${OSG} -DALUT_INCLUDE_DIR=${OSG}/include -DALUT_LIBRARY=${FREEALUT}/${OS}/${DEBUG_DIR}/libalut_static.a -DALUT_LIBRARY_DEBUG=${FREEALUT}/${OS}/${DEBUG_DIR}/libalut_static.a -D0_BUILD_EXAMPLES_OALPP=OFF -D0_BUILD_EXAMPLES_OSGAUDIO=OFF -D0_BUILD_EXAMPLES_OSGAUDIO_LOWLEVEL=OFF -D0_ENABLE_SUBSYSTEM_OPENAL=ON -D0_ENABLE_SUBSYSTEM_FMOD=OFF -DFMOD_INCLUDE_DIR=OFF -DFMOD_LIBRARY=OFF -DOSGAUDIO_INSTALL_DATA=OFF -DOPENAL_INCLUDE_DIR=${OPENAL}/include/AL -DOPENAL_LIBRARY=${OPENAL}/${OS}/${DEBUG_DIR}/libopenal.a -DOGG_INCLUDE_DIR=${OGG}/include -DOGG_LIBRARY=${OGG}/${OS}/${DEBUG_DIR}/src/.libs/libogg.a -DOGG_LIBRARY_DEBUG=${OGG}/${OS}/${DEBUG_DIR}/src/.libs/libogg.a -DVORBIS_INCLUDE_DIR=${VORBIS}/include -DVORBIS_LIBRARY=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbis.a -DVORBIS_LIBRARY_DEBUG=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbis.a -DVORBISFILE_INCLUDE_DIR=${VORBIS}/include -DVORBISFILE_LIBRARY=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbisfile.a -DVORBISFILE_LIBRARY_DEBUG=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbisfile.a ${OSGAUDIO})
LINUX_DEBUG_COMMAND(make)

DKSETPATH(${OSGAUDIO}/${OS}/${RELEASE_DIR})
LINUX_RELEASE_COMMAND(${CMAKE_EXE} -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_C_FLAGS=-fPIC "-DCMAKE_CXX_FLAGS=-I${OPENAL}/include -I${FREEALUT}/include" "-DOSGInstallType=Source And Build Tree" -DOSGBuildRoot=${OSG}/${OS}/${RELEASE_DIR} -DOSGSourceRoot=${OSG} -DALUT_INCLUDE_DIR=${OSG}/include -DALUT_LIBRARY=${FREEALUT}/${OS}/${RELEASE_DIR}/libalut_static.a -DALUT_LIBRARY_DEBUG=${FREEALUT}/${OS}/${DEBUG_DIR}/libalut_static.a -D0_BUILD_EXAMPLES_OALPP=OFF -D0_BUILD_EXAMPLES_OSGAUDIO=OFF -D0_BUILD_EXAMPLES_OSGAUDIO_LOWLEVEL=OFF -D0_ENABLE_SUBSYSTEM_OPENAL=ON -D0_ENABLE_SUBSYSTEM_FMOD=OFF -DFMOD_INCLUDE_DIR=OFF -DFMOD_LIBRARY=OFF -DOSGAUDIO_INSTALL_DATA=OFF -DOPENAL_INCLUDE_DIR=${OPENAL}/include/AL -DOPENAL_LIBRARY=${OPENAL}/${OS}/${RELEASE_DIR}/libopenal.a -DOGG_INCLUDE_DIR=${OGG}/include -DOGG_LIBRARY=${OGG}/${OS}/${RELEASE_DIR}/src/.libs/libogg.a -DOGG_LIBRARY_DEBUG=${OGG}/${OS}/${DEBUG_DIR}/src/.libs/libogg.a -DVORBIS_INCLUDE_DIR=${VORBIS}/include -DVORBIS_LIBRARY=${VORBIS}/${OS}/${RELEASE_DIR}/lib/.libs/libvorbis.a -DVORBIS_LIBRARY_DEBUG=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbis.a -DVORBISFILE_INCLUDE_DIR=${VORBIS}/include -DVORBISFILE_LIBRARY=${VORBIS}/${OS}/${RELEASE_DIR}/lib/.libs/libvorbisfile.a -DVORBISFILE_LIBRARY_DEBUG=${VORBIS}/${OS}/${DEBUG_DIR}/lib/.libs/libvorbisfile.a ${OSGAUDIO})
LINUX_RELEASE_COMMAND(make)


ANDROID_INCLUDE(${OSGAUDIO}/${OS})
ANDROID_NDK_DEBUG(osgaudio-master)
ANDROID_NDK_RELEASE(osgaudio-master)