## https://download.osgeo.org/libtiff/

### VERSION ###
DKSET(TIFF_VERSION 4.0.3)
DKSET(TIFF_NAME tiff-${TIFF_VERSION})
DKSET(TIFF ${3RDPARTY}/${TIFF_NAME})


### INSTALL ###
## https://download.osgeo.org/libtiff/old/tiff-4.0.3.zip
DKINSTALL(https://download.osgeo.org/libtiff/old/${TIFF_NAME}.zip tiff ${TIFF})


### DKPLUGINS LINK ###
DKINCLUDE(${TIFF}/libtiff)
WIN_DEBUG_LIB(${TIFF}/${OS}/${DEBUG_DIR}/tiff-static.lib)
WIN_RELEASE_LIB(${TIFF}/${OS}/${RELEASE_DIR}/tiff-static.lib)
APPLE_DEBUG_LIB(${TIFF}/${OS}/${DEBUG_DIR}/libtiff-static.a)
APPLE_RELEASE_LIB(${TIFF}/${OS}/${RELEASE_DIR}/libtiff-static.a)
LINUX_DEBUG_LIB(${TIFF}/${OS}/${DEBUG_DIR}/libtiff-static.a)
LINUX_RELEASE_LIB(${TIFF}/${OS}/${RELEASE_DIR}/libtiff-static.a)
RASPBERRY_DEBUG_LIB(${TIFF}/${OS}/${DEBUG_DIR}/libtiff-static.a)
RASPBERRY_RELEASE_LIB(${TIFF}/${OS}/${RELEASE_DIR}/libtiff-static.a)
##ANDROID_DEBUG_LIB(${TIFF}/${OS}/${DEBUG_DIR}/obj/local/armeabi-v7a/libtiff.a)
##ANDROID_RELEASE_LIB(${TIFF}/${OS}/${RELEASE_DIR}/obj/local/armeabi-v7a/libtiff.a)
ANDROID_DEBUG_LIB(${TIFF}/${OS}/${DEBUG_DIR}/libtiff-static.a)
ANDROID_RELEASE_LIB(${TIFF}/${OS}/${RELEASE_DIR}/libtiff-static.a)


### 3RDPARTY LINK ###
DKSET(TIFF_WIN -DTIFF_INCLUDE_DIR=${TIFF}/libtiff -DTIFF_INCLUDE_DIR2=${TIFF}/${OS} -DTIFF_LIBRARY_DEBUG=${TIFF}/${OS}/${DEBUG_DIR}/tiff-static.lib -DTIFF_LIBRARY_RELEASE=${TIFF}/${OS}/${RELEASE_DIR}/tiff-static.lib)
DKSET(TIFF_APPLE -DTIFF_INCLUDE_DIR=${TIFF}/libtiff -DTIFF_INCLUDE_DIR2=${TIFF}/${OS} -DTIFF_LIBRARY_DEBUG=${TIFF}/${OS}/${DEBUG_DIR}/libtiff-static.a -DTIFF_LIBRARY_RELEASE=${TIFF}/${OS}/${RELEASE_DIR}/libtiff-static.a)
DKSET(TIFF_LINUX "-DCMAKE_C_FLAGS_DEBUG=-I${TIFF}/${OS}/${DEBUG_DIR}" "-DCMAKE_CXX_FLAGS_DEBUG=-I${TIFF}/${OS}/${DEBUG_DIR}" -DTIFF_INCLUDE_DIR=${TIFF}/libtiff -DTIFF_INCLUDE_DIR2=${TIFF}/${OS}/${RELEASE_DIR} -DTIFF_LIBRARY_DEBUG=${TIFF}/${OS}/${DEBUG_DIR}/libtiff-static.a -DTIFF_LIBRARY_RELEASE=${TIFF}/${OS}/${RELEASE_DIR}/libtiff-static.a)
DKSET(TIFF_RASPBERRY "-DCMAKE_C_FLAGS_DEBUG=-I${TIFF}/${OS}/${DEBUG_DIR}" "-DCMAKE_CXX_FLAGS_DEBUG=-I${TIFF}/${OS}/${DEBUG_DIR}" -DTIFF_INCLUDE_DIR=${TIFF}/libtiff -DTIFF_INCLUDE_DIR2=${TIFF}/${OS}/${RELEASE_DIR} -DTIFF_LIBRARY_DEBUG=${TIFF}/${OS}/${DEBUG_DIR}/libtiff-static.a -DTIFF_LIBRARY_RELEASE=${TIFF}/${OS}/${RELEASE_DIR}/libtiff-static.a)
DKSET(TIFF_ANDROID -DTIFF_INCLUDE_DIR=${TIFF}/libtiff -DTIFF_INCLUDE_DIR2=${TIFF}/${OS} -DTIFF_LIBRARY_DEBUG=${TIFF}/${OS}/${DEBUG_DIR}/libtiff-static.a -DTIFF_LIBRARY_RELEASE=${TIFF}/${OS}/${RELEASE_DIR}/libtiff-static.a)
	

### COMPILE ###
WIN_PATH(${TIFF}/${OS})
WIN32_COMMAND(${DKCMAKE_WIN32} ${TIFF})
WIN64_COMMAND(${DKCMAKE_WIN64} ${TIFF})
WIN_VS(${TIFF_NAME} tiff.sln tiff-static)


MAC_PATH(${TIFF}/${OS})
MAC32_COMMAND(${DKCMAKE_MAC32} ${TIFF})
MAC64_COMMAND(${DKCMAKE_MAC64} ${TIFF})
MAC_XCODE(${TIFF_NAME} tiff-static)


IOS_PATH(${TIFF}/${OS})
IOS64_COMMAND(${DKCMAKE_IOS64} ${TIFF})
IOS_XCODE(${TIFF_NAME} tiff-static)


IOSSIM_PATH(${TIFF}/${OS})
IOSSIM64_COMMAND(${DKCMAKE_IOSSIM64} ${TIFF})
IOSSIM_XCODE(${TIFF_NAME} tiff-static)


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

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


RASPBERRY_DEBUG_PATH(${TIFF}/${OS}/${DEBUG_DIR})
RASPBERRY_DEBUG_COMMAND(${DKCMAKE_RASPBERRY_DEBUG} ${TIFF})
RASPBERRY_DEBUG_COMMAND(make tiff-static)

RASPBERRY_RELEASE_PATH(${TIFF}/${OS}/${RELEASE_DIR})
RASPBERRY_RELEASE_COMMAND(${DKCMAKE_RASPBERRY_RELEASE} ${TIFF})
RASPBERRY_RELEASE_COMMAND(make tiff-static)


##ANDROID_NDK(${TIFF_NAME})
ANDROID_PATH(${TIFF}/${OS})
ANDROID32_COMMAND(${DKCMAKE_ANDROID32_C} ${TIFF})
ANDROID64_COMMAND(${DKCMAKE_ANDROID64_C} ${TIFF})
ANDROID_VS(${TIFF_NAME} tiff.sln tiff-static)
