Commit c9f99029 authored by Sharaf Zaman's avatar Sharaf Zaman

Android: Add optional dependency libjpeg to the build

Maniphest: T10784
parent 4c43158d
......@@ -2,19 +2,29 @@ SET(PREFIX_ext_jpeg "${EXTPREFIX}" )
if (MINGW)
ExternalProject_Add( ext_jpeg
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/libjpeg-turbo-1.5.3.tar.gz
URL_MD5 7c82f0f6a3130ec06b8a4d0b321cbca3
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.2.tar.gz
URL_MD5 8badea1368f489ac4c520f01b1bc045b
INSTALL_DIR ${PREFIX_ext_jpeg}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_jpeg} -DWITH_SIMD=OFF -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE}
UPDATE_COMMAND ""
)
elseif (ANDROID)
ExternalProject_Add( ext_jpeg
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.2.tar.gz
URL_MD5 8badea1368f489ac4c520f01b1bc045b
CMAKE_ARGS -DANDROID_ABI=${ANDROID_ABI} -DANDROID_ARM_MODE=arm -DANDROID_PLATFORM=android-$ENV{ANDROID_API_LEVEL} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_jpeg} -DENABLE_SHARED=ON -DWITH_SIMD=OFF -DENABLE_STATIC=OFF _DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE}
UPDATE_COMMAND ""
)
else()
ExternalProject_Add( ext_jpeg
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/libjpeg-turbo-1.5.3.tar.gz
URL_MD5 7c82f0f6a3130ec06b8a4d0b321cbca3
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.2.tar.gz
URL_MD5 8badea1368f489ac4c520f01b1bc045b
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${PREFIX_ext_jpeg} ${GLOBAL_AUTOMAKE_PROFILE} --without-simd
BUILD_COMMAND make
......
......@@ -658,6 +658,8 @@ if (ANDROID)
set (FFTW3_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/)
set (GIF_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/i/lib/libgiflib.so)
set (GIF_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/include)
set (JPEG_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/i/lib/libjpeg.so)
set (JPEG_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/include)
endif()
......@@ -699,6 +701,9 @@ set_package_properties(JPEG PROPERTIES
URL "http://www.libjpeg-turbo.org"
TYPE OPTIONAL
PURPOSE "Required by the Krita JPEG filter")
if (JPEG_FOUND)
list (APPEND ANDROID_EXTRA_LIBS ${JPEG_LIBRARY})
endif()
find_package(GIF)
set_package_properties(GIF PROPERTIES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment