# https://github.com/uNetworking/uWebSockets/archive/v0.14.zip

DKDEPEND(zlib)
DKDEPEND(libuv)
##DKDEPEND(openssl)


### VERSION ###
DKSET(UWEBSOCKETS_MAJOR 0)
DKSET(UWEBSOCKETS_MINOR 14)
DKSET(UWEBSOCKETS_VERSION ${UWEBSOCKETS_MAJOR}.${UWEBSOCKETS_MINOR})
DKSET(UWEBSOCKETS_NAME uWebSockets-${UWEBSOCKETS_VERSION})
DKSET(UWEBSOCKETS_DL https://github.com/uNetworking/uWebSockets/archive/v${UWEBSOCKETS_VERSION}.zip)
DKSET(UWEBSOCKETS ${3RDPARTY}/${UWEBSOCKETS_NAME})



### INSTALL ###
DKINSTALL(${UWEBSOCKETS_DL} uwebsockets ${UWEBSOCKETS})



### LINK ###
DKINCLUDE(${UWEBSOCKETS})
DKINCLUDE(${UWEBSOCKETS}/${OS})
WIN_DEBUG_LIB(${UWEBSOCKETS}/${OS}/${DEBUG_DIR}/uWS.lib)
WIN_RELEASE_LIB(${UWEBSOCKETS}/${OS}/${RELEASE_DIR}/uWS.lib)
MAC_DEBUG_LIB(${UWEBSOCKETS}/${OS}/lib/${DEBUG_DIR}/uWS.a)
MAC_RELEASE_LIB(${UWEBSOCKETS}/${OS}/lib/${RELEASE_DIR}/uWS.a)
IOSSIM_DEBUG_LIB(${UWEBSOCKETS}/${OS}/${DEBUG_DIR}/lib/.libs/uWS.a)
IOSSIM_RELEASE_LIB(${UWEBSOCKETS}/${OS}/${RELEASE_DIR}/lib/.libs/uWS.a)
LINUX_DEBUG_LIB(${UWEBSOCKETS}/${OS}/${DEBUG_DIR}/uWS.a)
LINUX_RELEASE_LIB(${UWEBSOCKETS}/${OS}/${RELEASE_DIR}/uWS.a)
RASPBERRY_DEBUG_LIB(${UWEBSOCKETS}/${OS}/${DEBUG_DIR}/uWS.a)
RASPBERRY_RELEASE_LIB(${UWEBSOCKETS}/${OS}/${RELEASE_DIR}/uWS.a)
##ANDROID_DEBUG_LIB(${UWEBSOCKETS}/${OS}/${DEBUG_DIR}/obj/local/armeabi-v7a/uWS.a)
##ANDROID_RELEASE_LIB(${UWEBSOCKETS}/${OS}/${RELEASE_DIR}/obj/local/armeabi-v7a/uWS.a)
ANDROID_DEBUG_LIB(${UWEBSOCKETS}/${OS}/${DEBUG_DIR}/uWS.a)
ANDROID_RELEASE_LIB(${UWEBSOCKETS}/${OS}/${RELEASE_DIR}/uWS.a)



### COMPILE ###
WIN_PATH(${UWEBSOCKETS}/${OS})
WIN32_COMMAND(${DKCMAKE_WIN32} ${ZLIB_WIN} ${LIBUV_WIN} ${OPENSSL_WIN32} ${UWEBSOCKETS})
WIN64_COMMAND(${DKCMAKE_WIN64} ${ZLIB_WIN} ${LIBUV_WIN} ${OPENSSL_WIN64} ${UWEBSOCKETS})
WIN_VS(${UWEBSOCKETS_NAME} µWebSockets.sln uWS)


MAC_PATH(${UWEBSOCKETS}/${OS})
MAC64_COMMAND(${DKCMAKE_MAC64} ${ZLIB_APPLE} ${LIBUV_APPLE} ${OPENSSL_APPLE} ${UWEBSOCKETS})
MAC_XCODE(${UWEBSOCKETS_NAME} libuWS)


IOS_PATH(${UWEBSOCKETS}/${OS})
IOS64_COMMAND(${DKCMAKE_IOS64} ${ZLIB_APPLE} ${LIBUV_APPLE} ${OPENSSL_APPLE} ${UWEBSOCKETS})
IOS_XCODE(${UWEBSOCKETS_NAME} libuWS)


IOSSIM_PATH(${UWEBSOCKETS}/${OS})
IOSSIM64_COMMAND(${DKCMAKE_IOSSIM64} ${ZLIB_APPLE} ${LIBUV_APPLE} ${OPENSSL_APPLE} ${UWEBSOCKETS})
IOSSIM_XCODE(${UWEBSOCKETS_NAME} libuWS)


LINUX_DEBUG_PATH(${UWEBSOCKETS}/${OS}/${DEBUG_DIR})
LINUX_DEBUG_COMMAND(${DKCMAKE_LINUX_DEBUG} ${ZLIB_LINUX} ${LIBUV_LINUX} ${OPENSSL_LINUX} ${UWEBSOCKETS})
LINUX_DEBUG_COMMAND(make uWebSockets)

LINUX_RELEASE_PATH(${UWEBSOCKETS}/${OS}/${RELEASE_DIR})
LINUX_RELEASE_COMMAND(${DKCMAKE_LINUX_RELEASE} ${ZLIB_LINUX} ${LIBUV_LINUX} ${OPENSSL_LINUX} ${UWEBSOCKETS})
LINUX_RELEASE_COMMAND(make uWebSockets)


RASPBERRY_DEBUG_PATH(${UWEBSOCKETS}/${OS}/${DEBUG_DIR})
RASPBERRY_DEBUG_COMMAND(${DKCMAKE_RASPBERRY_DEBUG} ${ZLIB_RASPBERRY} ${LIBUV_RASPBERRY} ${OPENSSL_RASPBERRY} ${UWEBSOCKETS})
RASPBERRY_DEBUG_COMMAND(make uWebSockets)

RASPBERRY_RELEASE_PATH(${UWEBSOCKETS}/${OS}/${RELEASE_DIR})
RASPBERRY_RELEASE_COMMAND(${DKCMAKE_RASPBERRY_RELEASE} ${ZLIB_RASPBERRY} ${LIBUV_RASPBERRY} ${OPENSSL_RASPBERRY} ${UWEBSOCKETS})
RASPBERRY_RELEASE_COMMAND(make uWebSockets)


##ANDROID_NDK(${UWEBSOCKETS_NAME})
ANDROID_PATH(${UWEBSOCKETS}/${OS})
ANDROID32_COMMAND(${DKCMAKE_WIN32} ${ZLIB_ANDROID} ${LIBUV_ANDROID} ${OPENSSL_ANDROID} ${UWEBSOCKETS})
ANDROID64_COMMAND(${DKCMAKE_WIN64} ${ZLIB_ANDROID} ${LIBUV_ANDROID} ${OPENSSL_ANDROID} ${UWEBSOCKETS})
ANDROID_VS(${UWEBSOCKETS_NAME} µWebSockets.sln uWS)
