# http://lua_website.com
#
# https://www.lua.org/ftp/lua-5.4.3.tar.gz


### VERSION ###
DKSET(LUA_VERSION 5.4.3)
DKSET(LUA_NAME lua-${LUA_VERSION})
DKSET(LUA_DL https://www.lua.org/ftp/lua-${LUA_VERSION}.tar.gzp)
DKSET(LUA ${3RDPARTY}/${LUA_NAME})


### INSTALL ###
DKINSTALL(${LUA_DL} lua ${LUA})


### LINK ###
DKINCLUDE(${LUA}/include)
DKINCLUDE(${LUA}/${OS})
WIN_DEBUG_LIB(${LUA}/${OS}/${DEBUG_DIR}/luad.lib)
WIN_RELEASE_LIB(${LUA}/${OS}/${RELEASE_DIR}/lua.lib)
APPLE_DEBUG_LIB(${LUA}/${OS}/${DEBUG_DIR}/luad.a)
APPLE_RELEASE_LIB(${LUA}/${OS}/${RELEASE_DIR}/lua.a)
LINUX_DEBUG_LIB(${LUA}/${OS}/${DEBUG_DIR}/luad.a)
LINUX_RELEASE_LIB(${LUA}/${OS}/${RELEASE_DIR}/lua.a)
RASPBERRY_DEBUG_LIB(${LUA}/${OS}/${DEBUG_DIR}/luad.a)
RASPBERRY_RELEASE_LIB(${LUA}/${OS}/${RELEASE_DIR}/lua.a)
ANDROID_DEBUG_LIB(${LUA}/${OS}/${DEBUG_DIR}/luad.a)
ANDROID_RELEASE_LIB(${LUA}/${OS}/${RELEASE_DIR}/lua.a)


### COMPILE ###
WIN_PATH(${LUA}/${OS})
WIN32_COMMAND(${DKCMAKE_WIN32} ${LUA})
WIN64_COMMAND(${DKCMAKE_WIN64} ${LUA})
WIN_VS(${LUA_NAME} lua.sln lua)


MAC_PATH(${LUA}/${OS})
MAC32_COMMAND(${DKCMAKE_MAC32} ${LUA})
MAC64_COMMAND(${DKCMAKE_MAC64} ${LUA})
MAC_XCODE(${LUA_NAME} lua)


IOS_PATH(${LUA}/${OS})
IOS32_COMMAND(${DKCMAKE_IOS32} ${LUA})
IOS64_COMMAND(${DKCMAKE_IOS64} ${LUA})
IOS_XCODE(${LUA_NAME} lua)


IOSSIM_PATH(${LUA}/${OS})
IOSSIM32_COMMAND(${DKCMAKE_IOSSIM32} ${LUA})
IOSSIM64_COMMAND(${DKCMAKE_IOSSIM64} ${LUA})
IOSSIM_XCODE(${LUA_NAME} lua)


LINUX_DEBUG_PATH(${LUA}/${OS}/${DEBUG_DIR})
LINUX_DEBUG_COMMAND(${DKCMAKE_LINUX_DEBUG} ${LUA})
LINUX_DEBUG_COMMAND(make lua)

LINUX_RELEASE_PATH(${LUA}/${OS}/${RELEASE_DIR})
LINUX_RELEASE_COMMAND(${DKCMAKE_LINUX_RELEASE} ${LUA})
LINUX_RELEASE_COMMAND(make lua)


RASPBERRY_DEBUG_PATH(${LUA}/${OS}/${DEBUG_DIR})
RASPBERRY_DEBUG_COMMAND(${DKCMAKE_RASPBERRY_DEBUG} ${LUA})
RASPBERRY_DEBUG_COMMAND(make lua)

RASPBERRY_RELEASE_PATH(${LUA}/${OS}/${RELEASE_DIR})
RASPBERRY_RELEASE_COMMAND(${DKCMAKE_RASPBERRY_RELEASE} ${LUA})
RASPBERRY_RELEASE_COMMAND(make lua)


##ANDROID_NDK(${LUA_NAME})
ANDROID_PATH(${LUA}/${OS})
ANDROID32_COMMAND(${DKCMAKE_ANDROID32} ${LUA})
ANDROID64_COMMAND(${DKCMAKE_ANDROID64} ${LUA})
ANDROID_VS(${LUA_NAME} lua.sln lua)
