# https://github.com/vancegroup/freealut
#
# http://distro.ibiblio.org/rootlinux/rootlinux-ports/more/freealut/freealut-1.1.0.tar.gz

### DEPENDS ###
DKDEPEND(msinttypes)
DKDEPEND(openal)



### VERSION ###
DKSET(FREEALUT_VERSION 1.1.0)
DKSET(FREEALUT_NAME freealut-${FREEALUT_VERSION})
DKSET(FREEALUT_DL http://distro.ibiblio.org/rootlinux/rootlinux-ports/more/freealut/${FREEALUT_NAME}.tar.gz)
DKSET(FREEALUT ${3RDPARTY}/${FREEALUT_NAME})



### INSTALL ###
DKINSTALL(${FREEALUT_DL} freealut ${FREEALUT})



### LINK ###
DKDEFINE(AL_LIBTYPE_STATIC)
DKINCLUDE(${FREEALUT}/include)
WIN_DEBUG_LIB(${FREEALUT}/${OS}/${DEBUG_DIR}/alut_static.lib)
WIN_RELEASE_LIB(${FREEALUT}/${OS}/${RELEASE_DIR}/alut_static.lib)
APPLE_DEBUG_LIB(${FREEALUT}/${OS}/${DEBUG_DIR}/libalut_static.a)
APPLE_RELEASE_LIB(${FREEALUT}/${OS}/${RELEASE_DIR}/libalut_static.a)
LINUX_DEBUG_LIB(${FREEALUT}/${OS}/${DEBUG_DIR}/libalut_static.a)
LINUX_RELEASE_LIB(${FREEALUT}/${OS}/${RELEASE_DIR}/libalut_static.a)



### COMPILE ###
WIN_PATH(${FREEALUT}/${OS})
WIN32_COMMAND(${DKCMAKE_WIN32} "-DCMAKE_C_FLAGS=/DWIN32 /D_WINDOWS /W3 /nologo /GR /EHsc /I${OPENAL}/include/AL /I${MSINTTYPES} /DAL_LIBTYPE_STATIC" ${OPENAL_WIN} ${FREEALUT})
WIN64_COMMAND(${DKCMAKE_WIN64} "-DCMAKE_C_FLAGS=/DWIN64 /D_WINDOWS /W3 /nologo /GR /EHsc /I${OPENAL}/include/AL /I${MSINTTYPES} /DAL_LIBTYPE_STATIC" ${OPENAL_WIN} ${FREEALUT})
WIN_VS(${FREEALUT_NAME} Alut.sln alut_static)


MAC_PATH(${FREEALUT}/${OS})
MAC64_COMMAND(${DKCMAKE_MAC64} ${OPENAL_MAC} ${FREEALUT})
MAC_XCODE(${FREEALUT_NAME} alut_static)


LINUX_DEBUG_PATH(${FREEALUT}/${OS}/${DEBUG_DIR})
LINUX_DEBUG_COMMAND(${DKCMAKE_LINUX_DEBUG} ${OPENAL_LINUX} ${FREEALUT})
LINUX_DEBUG_COMMAND(make alut_static)

LINUX_RELEASE_PATH(${FREEALUT}/${OS}/${RELEASE_DIR})
LINUX_RELEASE_COMMAND(${DKCMAKE_LINUX_RELEASE} ${OPENAL_LINUX} ${FREEALUT})
LINUX_RELEASE_COMMAND(make alut_static)
