Commit 62b6aa46 authored by Sharaf Zaman's avatar Sharaf Zaman

[ANDROID] patch for building GSL

Task: T10784
parent 46875806
......@@ -8,7 +8,8 @@ ExternalProject_Add( ext_gsl
URL http://files.kde.org/krita/build/dependencies/gsl-2.3.0.tar.gz
URL_MD5 7e0478f7c5e62696fef480b9a46f708c
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/gsl-android.patch
INSTALL_DIR ${EXTPREFIX_gsl}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_gsl} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DGSL_SHARED=ON -DBUILD_TESTING=OFF
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTPREFIX_gsl} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DANDROID_PLATFORM=${ANDROID_PLATFORM}
UPDATE_COMMAND ""
)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -386,6 +386,7 @@
# Compiles the source code, runs the program and sets ${VAR} to 1 if the
# return value is equal to ${RESULT}.
macro(check_run_result SRC RESULT VAR)
+ if (NOT ANDROID)
set(SRC_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c)
file(WRITE ${SRC_FILE} "${SRC}")
try_run(RUN_RESULT COMPILE_RESULT ${CMAKE_BINARY_DIR} ${SRC_FILE}
@@ -393,6 +394,9 @@
if (RUN_RESULT EQUAL ${RESULT})
set(${VAR} 1)
endif ()
+ else()
+ set(${VAR} 1)
+ endif()
endmacro()
# Check IEEE comparisons, whether "x != x" is true for NaNs.
......@@ -529,7 +529,16 @@ if(WIN32)
endif()
# set custom krita plugin installdir
set(KRITA_PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/kritaplugins)
if (ANDROID)
if (NOT ANDROID_ABI)
set (ANDROID_ABI armeabi-v7a)
endif()
set (KRITA_PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/${ANDROID_ABI})
set (DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/assets)
else()
set (KRITA_PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/kritaplugins)
endif()
###########################
############################
......@@ -546,8 +555,12 @@ if (ANDROID)
set (LCMS2_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/i/lib/liblcms2.so)
set (QUAZIP_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/include/quazip5)
set (QUAZIP_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/i/lib/libquazip5.so)
set (Boost_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/armeabi-v7a/include/boost-1_69)
set (Boost_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/armeabi-v7a/lib)
set (Boost_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/${ANDROID_ABI}/include/boost-1_69)
set (Boost_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/${ANDROID_ABI}/lib)
set (GSL_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/i/lib/libgsl.so)
set (GSL_CBLAS_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/i/lib/libgslcblas.so)
set (GSL_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/i/include/)
set (GSL_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/i/bin/gsl-config)
endif()
find_package(PNG REQUIRED)
......
......@@ -32,6 +32,10 @@ else()
set(__per_arch_circle_mask_generator_objs kis_brush_mask_applicator_factories.cpp)
endif()
if (GSL_FOUND)
include_directories(${GSL_INCLUDE_DIR})
endif()
set(kritaimage_LIB_SRCS
tiles3/kis_tile.cc
tiles3/kis_tile_data.cc
......
......@@ -36,4 +36,5 @@ cmake --build . --config RelWithDebInfo --target ext_lcms2
# this one SHOULD be built before exiv
cmake --build . --config RelWithDebInfo --target ext_expat
cmake --build . --config RelWithDebInfo --target ext_exiv2
cmake --build . --config RelWithDebInfo --target ext_gsl
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