Headers are included into opencv_java build
This commit is contained in:
parent
4deec6f0f0
commit
39dab5e0cf
@ -10,19 +10,18 @@ cd package
|
||||
PRG_DIR=`pwd`
|
||||
mkdir opencv
|
||||
|
||||
|
||||
# neon-enabled build
|
||||
cd $PRG_DIR
|
||||
mkdir build-neon
|
||||
cd build-neon
|
||||
#cd $PRG_DIR
|
||||
#mkdir build-neon
|
||||
#cd build-neon
|
||||
|
||||
cmake -C "$ANDROID_DIR/CMakeCache.android.initial.cmake" -DARM_TARGET="armeabi-v7a with NEON" -DBUILD_DOCS=OFF -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ANDROID_EXAMPLES=OFF -DCMAKE_TOOLCHAIN_FILE="$ANDROID_DIR/android.toolchain.cmake" -DCMAKE_INSTALL_PREFIX="$PRG_DIR/opencv" "$ANDROID_DIR/.." || exit 1
|
||||
make -j8 install/strip || exit 1
|
||||
#cmake -C "$ANDROID_DIR/CMakeCache.android.initial.cmake" -DARM_TARGET="armeabi-v7a with NEON" -DBUILD_DOCS=OFF -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ANDROID_EXAMPLES=OFF -DCMAKE_TOOLCHAIN_FILE="$ANDROID_DIR/android.toolchain.cmake" -DCMAKE_INSTALL_PREFIX="$PRG_DIR/opencv" "$ANDROID_DIR/.." || exit 1
|
||||
#make -j8 install/strip || exit 1
|
||||
|
||||
cd "$PRG_DIR/opencv"
|
||||
rm -rf doc include src .classpath .project AndroidManifest.xml default.properties share/OpenCV/haarcascades share/OpenCV/lbpcascades share/OpenCV/*.cmake share/OpenCV/OpenCV.mk
|
||||
mv libs/armeabi-v7a libs/armeabi-v7a-neon
|
||||
mv share/OpenCV/3rdparty/libs/armeabi-v7a share/OpenCV/3rdparty/libs/armeabi-v7a-neon
|
||||
#cd "$PRG_DIR/opencv"
|
||||
#rm -rf doc include src .classpath .project AndroidManifest.xml default.properties share/OpenCV/haarcascades share/OpenCV/lbpcascades share/OpenCV/*.cmake share/OpenCV/OpenCV.mk
|
||||
#mv libs/armeabi-v7a libs/armeabi-v7a-neon
|
||||
#mv share/OpenCV/3rdparty/libs/armeabi-v7a share/OpenCV/3rdparty/libs/armeabi-v7a-neon
|
||||
|
||||
|
||||
# armeabi-v7a build
|
||||
@ -54,8 +53,8 @@ cp "$ANDROID_DIR/../README" opencv/
|
||||
|
||||
# get opencv version
|
||||
CV_VERSION=`grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+" opencv/share/OpenCV/OpenCVConfig-version.cmake`
|
||||
mv opencv opencv$CV_VERSION
|
||||
|
||||
OPENCV_NAME=OpenCV-$CV_VERSION
|
||||
mv opencv $OPENCV_NAME
|
||||
|
||||
#samples
|
||||
cp -r "$ANDROID_DIR/../samples/android" "$PRG_DIR/samples"
|
||||
@ -72,7 +71,7 @@ do
|
||||
if [ $HAS_REFERENCE = 1 ]
|
||||
then
|
||||
echo -n > "$dir/default.properties"
|
||||
android update project --name "$dir" --target "android-8" --library "../../opencv$CV_VERSION" --path "$dir"
|
||||
android update project --name "$dir" --target "android-8" --library "../../$OPENCV_NAME" --path "$dir"
|
||||
#echo 'android update project --name "$dir" --target "android-8" --library "../opencv$CV_VERSION" --path "$dir"'
|
||||
fi
|
||||
else
|
||||
@ -89,8 +88,6 @@ cd "$PRG_DIR/samples"
|
||||
svn status --no-ignore | grep ^I | cut -c9- | xargs -d \\n rm -rf
|
||||
#remove unversioned files/folders
|
||||
svn status | grep ^\? | cut -c9- | xargs -d \\n rm -rf
|
||||
#remove unneded CMakeLists.txt
|
||||
rm CMakeLists.txt
|
||||
|
||||
|
||||
#generate "gen" folders to eliminate eclipse warnings
|
||||
@ -106,11 +103,12 @@ done
|
||||
|
||||
#generate folders "gen" and "res" for opencv (dummy eclipse stiff)
|
||||
cd $PRG_DIR
|
||||
mkdir "opencv$CV_VERSION/gen"
|
||||
mkdir "opencv$CV_VERSION/res"
|
||||
mkdir "$OPENCV_NAME/gen"
|
||||
mkdir "$OPENCV_NAME/res"
|
||||
|
||||
# pack all files
|
||||
cd $PRG_DIR
|
||||
tar cjpf opencv$CV_VERSION.tar.bz2 --exclude-vcs opencv$CV_VERSION samples || exit -1
|
||||
PRG_NAME=OpenCV-$CV_VERSION-tp-android-bin.tar.bz2
|
||||
tar cjpf $PRG_NAME --exclude-vcs $OPENCV_NAME samples || exit -1
|
||||
echo
|
||||
echo "Package opencv$CV_VERSION.tar.bz2 is successfully created"
|
||||
echo "Package $PRG_NAME is successfully created"
|
||||
|
@ -43,7 +43,7 @@ foreach(module ${OPENCV_JAVA_MODULES})
|
||||
endforeach()
|
||||
|
||||
set(target opencv_java)
|
||||
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
||||
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/src/cpp")
|
||||
|
||||
SET (generated_cpp_sources "")
|
||||
SET (generated_java_sources "")
|
||||
@ -63,6 +63,7 @@ foreach(module ${OPENCV_EXTRA_JAVA_MODULES})
|
||||
endforeach()
|
||||
|
||||
FILE(GLOB handwrittren_cpp_sources "${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/*.cpp")
|
||||
FILE(GLOB handwrittren_h_sources "${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/*.h*")
|
||||
|
||||
add_library(${target} SHARED ${handwrittren_cpp_sources} ${generated_cpp_sources})
|
||||
target_link_libraries(${target} ${dependent_libs} ${dependent_extra_libs} ${OPENCV_LINKER_LIBS})
|
||||
@ -117,7 +118,7 @@ IF(ANDROID)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(jni_file ${handwrittren_cpp_sources} ${generated_cpp_sources})
|
||||
foreach(jni_file ${handwrittren_cpp_sources} ${handwrittren_h_sources} ${generated_cpp_sources})
|
||||
get_filename_component(jni_file_name "${jni_file}" NAME)
|
||||
add_custom_command(
|
||||
TARGET ${api_target}
|
||||
|
Loading…
x
Reference in New Issue
Block a user