# https://www.freetype.org/
#
# https://sourceforge.net/projects/freetype/files/freetype2/2.5.5/freetype-2.5.5.tar.gz


### VERSION ###
DKSET(FREETYPE_MAJOR 2)
DKSET(FREETYPE_MINOR 5)
DKSET(FREETYPE_BUILD 5)
DKSET(FREETYPE_VERSION ${FREETYPE_MAJOR}.${FREETYPE_MINOR}.${FREETYPE_BUILD})
DKSET(FREETYPE_NAME freetype-${FREETYPE_VERSION})
DKSET(FREETYPE_DL https://sourceforge.net/projects/freetype/files/freetype2/${FREETYPE_MAJOR}.${FREETYPE_MINOR}.${FREETYPE_BUILD}/${FREETYPE_NAME}.tar.gz)
DKSET(FREETYPE ${3RDPARTY}/${FREETYPE_NAME})


### INSTALL ###
DKINSTALL(${FREETYPE_DL} freetype ${FREETYPE})


### DKPLUGINS LINK ###
DKINCLUDE(${FREETYPE}/include)
DKINCLUDE(${FREETYPE}/${OS}/include/freetype2)
WIN_DEBUG_LIB(${FREETYPE}/${OS}/${DEBUG_DIR}/freetype.lib)
WIN_RELEASE_LIB(${FREETYPE}/${OS}/${RELEASE_DIR}/freetype.lib)
MAC_DEBUG_LIB(${FREETYPE}/${OS}/${DEBUG_DIR}/libfreetype.a)
MAC_RELEASE_LIB(${FREETYPE}/${OS}/${RELEASE_DIR}/libfreetype.a)
IOSSIM_DEBUG_LIB(${FREETYPE}/${OS}/${DEBUG_DIR}/libfreetype.a)
IOSSIM_RELEASE_LIB(${FREETYPE}/${OS}/${RELEASE_DIR}/libfreetype.a)
LINUX_DEBUG_LIB(${FREETYPE}/${OS}/${DEBUG_DIR}/libfreetype.a)
LINUX_RELEASE_LIB(${FREETYPE}/${OS}/${RELEASE_DIR}/libfreetype.a)
RASPBERRY_DEBUG_LIB(${FREETYPE}/${OS}/${DEBUG_DIR}/libfreetype.a)
RASPBERRY_RELEASE_LIB(${FREETYPE}/${OS}/${RELEASE_DIR}/libfreetype.a)
ANDROID_DEBUG_LIB(${FREETYPE}/${OS}/${DEBUG_DIR}/libfreetype.a)
ANDROID_RELEASE_LIB(${FREETYPE}/${OS}/${RELEASE_DIR}/libfreetype.a)



### 3RDPARTY LINK ###
DKSET(FREETYPE_WIN -DFREETYPE_INCLUDE_DIRS=${FREETYPE}/include -DFREETYPE_INCLUDE_DIR_freetype2=${FREETYPE}/${OS}/include/freetype2 -DFREETYPE_INCLUDE_DIR_ft2build=${FREETYPE}/include -DFREETYPE_LIBRARY_DEBUG=${FREETYPE}/${OS}/${DEBUG_DIR}/freetype.lib -DFREETYPE_LIBRARY_RELEASE=${FREETYPE}/${OS}/${RELEASE_DIR}/freetype.lib)
DKSET(FREETYPE_APPLE -DFREETYPE_INCLUDE_DIRS=${FREETYPE}/include -DFREETYPE_INCLUDE_DIR_freetype2=${FREETYPE}/${OS}/include/freetype2 -DFREETYPE_INCLUDE_DIR_ft2build=${FREETYPE}/include -DFREETYPE_LIBRARY_DEBUG=${FREETYPE}/${OS}/${DEBUG_DIR}/libfreetype.a -DFREETYPE_LIBRARY_RELEASE=${FREETYPE}/${OS}/${RELEASE_DIR}/libfreetype.a)
DKSET(FREETYPE_LINUX -DFREETYPE_INCLUDE_DIRS=${FREETYPE}/include -DFREETYPE_INCLUDE_DIR_freetype2=${FREETYPE}/${OS}/include/freetype2 -DFREETYPE_INCLUDE_DIR_ft2build=${FREETYPE}/include -DFREETYPE_LIBRARY_DEBUG=${FREETYPE}/${OS}/${DEBUG_DIR}/libfreetype.a -DFREETYPE_LIBRARY_RELEASE=${FREETYPE}/${OS}/${RELEASE_DIR}/libfreetype.a)
DKSET(FREETYPE_RASPBERRY -DFREETYPE_INCLUDE_DIRS=${FREETYPE}/include -DFREETYPE_INCLUDE_DIR_freetype2=${FREETYPE}/${OS}/include/freetype2 -DFREETYPE_INCLUDE_DIR_ft2build=${FREETYPE}/include -DFREETYPE_LIBRARY_DEBUG=${FREETYPE}/${OS}/${DEBUG_DIR}/libfreetype.a -DFREETYPE_LIBRARY_RELEASE=${FREETYPE}/${OS}/${RELEASE_DIR}/libfreetype.a)
DKSET(FREETYPE_ANDROID -DFREETYPE_INCLUDE_DIRS=${FREETYPE}/include -DFREETYPE_INCLUDE_DIR_freetype2=${FREETYPE}/${OS}/include/freetype2 -DFREETYPE_INCLUDE_DIR_ft2build=${FREETYPE}/include -DFREETYPE_LIBRARY_DEBUG=${FREETYPE}/${OS}/${DEBUG_DIR}/libfreetype.a -DFREETYPE_LIBRARY_RELEASE=${FREETYPE}/${OS}/${RELEASE_DIR}/libfreetype.a)
	
	
	
### COMPILE ###
WIN_PATH(${FREETYPE}/${OS})
WIN32_COMMAND(${DKCMAKE_WIN32} ${FREETYPE})
WIN64_COMMAND(${DKCMAKE_WIN64} ${FREETYPE})
WIN_VS(${FREETYPE_NAME} freetype.sln freetype)


MAC_PATH(${FREETYPE}/${OS})
MAC64_COMMAND(${DKCMAKE_MAC64} ${FREETYPE})
MAC_XCODE(${FREETYPE_NAME} freetype)


IOS_PATH(${FREETYPE}/${OS})
IOS64_COMMAND(${DKCMAKE_IOS64} ${FREETYPE})
IOS_XCODE(${FREETYPE_NAME} freetype)


IOSSIM_PATH(${FREETYPE}/${OS})
IOSSIM64_COMMAND(${DKCMAKE_IOSSIM64}  ${FREETYPE})
IOSSIM_XCODE(${FREETYPE_NAME} freetype)
## DKSETPATH(${FREETYPE}/${OS}/${DEBUG_DIR})
## IOSSIM_DEBUG_COMMAND(../../configure --enable-static=yes --enable-shared=no --without-bzip2 "CFLAGS=-arch x86_64")
## IOSSIM_DEBUG_COMMAND(make)
## DKSETPATH(${FREETYPE}/${OS}/${RELEASE_DIR})
## IOSSIM_RELEASE_COMMAND(../../configure --enable-static=yes --enable-shared=no --without-bzip2 "CFLAGS=-arch x86_64")
## IOSSIM_RELEASE_COMMAND(make)


LINUX_DEBUG_PATH(${FREETYPE}/${OS}/${DEBUG_DIR})
LINUX_DEBUG_COMMAND(${DKCMAKE_LINUX_DEBUG} ${FREETYPE})
LINUX_DEBUG_COMMAND(make freetype)

LINUX_RELEASE_PATH(${FREETYPE}/${OS}/${RELEASE_DIR})
LINUX_RELEASE_COMMAND(${DKCMAKE_LINUX_RELEASE} ${FREETYPE})
LINUX_RELEASE_COMMAND(make freetype)


RASPBERRY_DEBUG_PATH(${FREETYPE}/${OS}/${DEBUG_DIR})
RASPBERRY_DEBUG_COMMAND(${DKCMAKE_RASPBERRY_DEBUG} ${FREETYPE})
RASPBERRY_DEBUG_COMMAND(make freetype)

RASPBERRY_RELEASE_PATH(${FREETYPE}/${OS}/${RELEASE_DIR})
RASPBERRY_RELEASE_COMMAND(${DKCMAKE_RASPBERRY_RELEASE} ${FREETYPE})
RASPBERRY_RELEASE_COMMAND(make freetype)


##ANDROID_NDK(${FREETYPE_NAME})
ANDROID_PATH(${FREETYPE}/${OS})
ANDROID32_COMMAND(${DKCMAKE_ANDROID32} ${FREETYPE})
ANDROID64_COMMAND(${DKCMAKE_ANDROID64} ${FREETYPE})
ANDROID_VS(${FREETYPE_NAME} freetype.sln freetype)