# https://github.com/htacg/tidy-html5/archive/5.7.28.zip

### VERSION ###
DKSET(TIDY_MAJOR 5)
DKSET(TIDY_MINOR 8)
DKSET(TIDY_BUILD 0)
DKSET(TIDY_VERSION ${TIDY_MAJOR}.${TIDY_MINOR}.${TIDY_BUILD})
DKSET(TIDY_NAME tidy-html5-${TIDY_VERSION})
DKSET(TIDY ${3RDPARTY}/${TIDY_NAME})


### INSTALL ###
DKINSTALL(https://github.com/htacg/tidy-html5/archive/refs/tags/${TIDY_MAJOR}.${TIDY_MINOR}.${TIDY_BUILD}.zip tidy-html5 ${TIDY})



### LINK ###
DKINCLUDE(${TIDY})
DKINCLUDE(${TIDY}/include)
DKINCLUDE(${TIDY}/${OS})
ANDROID_INCLUDE(${TIDY}/${OS}/$(BUILD_TYPE)/jni)
WIN_DEBUG_LIB(${TIDY}/${OS}/${DEBUG_DIR}/tidy_staticd.lib)
WIN_RELEASE_LIB(${TIDY}/${OS}/${RELEASE_DIR}/tidy_static.lib)
APPLE_DEBUG_LIB(${TIDY}/${OS}/${DEBUG_DIR}/libtidy.a)
APPLE_RELEASE_LIB(${TIDY}/${OS}/${RELEASE_DIR}/libtidy.a)
LINUX_DEBUG_LIB(${TIDY}/${OS}/${DEBUG_DIR}/libtidy.a)
LINUX_RELEASE_LIB(${TIDY}/${OS}/${RELEASE_DIR}/libtidy.a)
RASPBERRY_DEBUG_LIB(${TIDY}/${OS}/${DEBUG_DIR}/libtidy.a)
RASPBERRY_RELEASE_LIB(${TIDY}/${OS}/${RELEASE_DIR}/libtidy.a)
#ANDROID_DEBUG_LIB(${TIDY}/${OS}/${DEBUG_DIR}/obj/local/armeabi-v7a/libtidys.a)
#ANDROID_RELEASE_LIB(${TIDY}/${OS}/${RELEASE_DIR}/obj/local/armeabi-v7a/libtidys.a)
ANDROID_DEBUG_LIB(${TIDY}/${OS}/${DEBUG_DIR}/libtidy.a)
ANDROID_RELEASE_LIB(${TIDY}/${OS}/${RELEASE_DIR}/libtidy.a)


### COMPILE ###
WIN_PATH(${TIDY}/${OS})
WIN32_COMMAND(${DKCMAKE_WIN32} ${ZLIB_WIN} ${TIDY})
WIN64_COMMAND(${DKCMAKE_WIN64} ${ZLIB_WIN} ${TIDY})
WIN_VS(${TIDY_NAME} tidy.sln tidy-static)


MAC_PATH(${TIDY}/${OS})
MAC64_COMMAND(${DKCMAKE_MAC64} ${ZLIB_APPLE} ${TIDY})
MAC_XCODE(${TIDY_NAME} tidy)


IOS_PATH(${TIDY}/${OS})
IOS64_COMMAND(${DKCMAKE_IOS64} ${ZLIB_APPLE} ${TIDY})
IOS_XCODE(${TIDY_NAME} tidy)


IOSSIM_PATH(${TIDY}/${OS})
IOSSIM64_COMMAND(${DKCMAKE_IOSSIM64} ${ZLIB_APPLE} ${TIDY})
IOSSIM_XCODE(${TIDY_NAME} tidy)


LINUX_DEBUG_PATH(${TIDY}/${OS}/${DEBUG_DIR})
LINUX_DEBUG_COMMAND(${DKCMAKE_LINUX_DEBUG} ${ZLIB_LINUX} ${TIDY})
LINUX_DEBUG_COMMAND(make tidy)

LINUX_RELEASE_PATH(${TIDY}/${OS}/${RELEASE_DIR})
LINUX_RELEASE_COMMAND(${DKCMAKE_LINUX_RELEASE} ${ZLIB_LINUX} ${TIDY})
LINUX_RELEASE_COMMAND(make tidy)


RASPBERRY_DEBUG_PATH(${TIDY}/${OS}/${DEBUG_DIR})
RASPBERRY_DEBUG_COMMAND(${DKCMAKE_RASPBERRY_DEBUG} ${ZLIB_RASPBERRY} ${TIDY})
RASPBERRY_DEBUG_COMMAND(make tidy)

RASPBERRY_RELEASE_PATH(${TIDY}/${OS}/${RELEASE_DIR})
RASPBERRY_RELEASE_COMMAND(${DKCMAKE_RASPBERRY_RELEASE} ${ZLIB_RASPBERRY} ${TIDY})
RASPBERRY_RELEASE_COMMAND(make tidy)


#ANDROID_NDK(${TIDY_NAME})
ANDROID_PATH(${TIDY}/${OS})
ANDROID32_COMMAND(${DKCMAKE_WIN32} ${ZLIB_ANDROID} ${TIDY})
ANDROID64_COMMAND(${DKCMAKE_WIN64} ${ZLIB_ANDROID} ${TIDY})
ANDROID_VS(${TIDY_NAME} tidy.sln tidy-static)
