diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt index e1b0a9aa1..81e29442f 100644 --- a/modules/java/CMakeLists.txt +++ b/modules/java/CMakeLists.txt @@ -14,16 +14,6 @@ SET(HDR_PARSER "${CMAKE_CURRENT_SOURCE_DIR}/../python/src2/hdr_parser.py") SET(GEN_JAVADOC "${CMAKE_CURRENT_SOURCE_DIR}/gen_javadoc.py") SET(RST_PARSER "${CMAKE_CURRENT_SOURCE_DIR}/rst_parser.py") -#SET_SOURCE_FILES_PROPERTIES("${GEN_JAVA}" PROPERTIES GENERATED TRUE) -#SET_SOURCE_FILES_PROPERTIES("${HDR_PARSER}" PROPERTIES GENERATED TRUE) -#SET_SOURCE_FILES_PROPERTIES("${GEN_JAVADOC}" PROPERTIES GENERATED TRUE) -#SET_SOURCE_FILES_PROPERTIES("${RST_PARSER}" PROPERTIES GENERATED TRUE) - -#add_custom_command( -# OUTPUT "${GEN_JAVA}" -# COMMAND ${CMAKE_COMMAND} -E echo "!!!!!!" -#) - SET(additional_clean_files "") macro(cleanup) @@ -222,6 +212,7 @@ if(ANDROID) add_custom_command( OUTPUT "${CMAKE_BINARY_DIR}/jni/${jni_file_name}" COMMAND ${CMAKE_COMMAND} -E copy "${jni_file}" "${CMAKE_BINARY_DIR}/jni/${jni_file_name}" + COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_BINARY_DIR}/jni/${jni_file_name}" DEPENDS "${jni_file}" COMMENT "Generating jni/${jni_file_name}" ) @@ -233,90 +224,6 @@ endif() # apply dependencies SET_SOURCE_FILES_PROPERTIES("${dependency_file}" PROPERTIES OBJECT_DEPENDS "${opencv_java_dependency_files}") - -#set(api_target opencv_java_api) -#add_custom_target(${api_target} ALL DEPENDS ${target}) - -IF(OFF) - # create Android library project in build folder - add_custom_command( - TARGET ${target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/res" - COMMENT "Creating res directory" - ) - - FILE(GLOB android_lib_project_files "${CMAKE_CURRENT_SOURCE_DIR}/android/*") - foreach(lib_file ${android_lib_project_files}) - if(NOT IS_DIRECTORY ${lib_file}) - get_filename_component(lib_file_name "${lib_file}" NAME) - add_custom_command( - TARGET ${api_target} - COMMAND ${CMAKE_COMMAND} -E copy "${lib_file}" "${CMAKE_BINARY_DIR}" - DEPENDS "${lib_file}" - COMMENT "Generating ${lib_file_name}" - ) - install(FILES "${CMAKE_BINARY_DIR}/${lib_file_name}" DESTINATION . COMPONENT main) - LIST(APPEND additional_clean_files "${CMAKE_BINARY_DIR}/${lib_file_name}") - endif() - endforeach() - - 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} - COMMAND ${CMAKE_COMMAND} -E copy "${jni_file}" "${CMAKE_BINARY_DIR}/jni/${jni_file_name}" - DEPENDS "${jni_file}" - COMMENT "Generating jni/${jni_file_name}" - ) - LIST(APPEND additional_clean_files "${CMAKE_BINARY_DIR}/jni/${jni_file_name}") - endforeach() -ENDIF() - -# generate javadoc comments -#FILE(GLOB java_project_files "${CMAKE_CURRENT_SOURCE_DIR}/src/java/*.java") - -#SET(documented_java_files) -#foreach(java_file ${java_project_files} ${generated_java_sources}) -# get_filename_component(java_file_name "${java_file}" NAME_WE) -# if (NOT java_file_name MATCHES ".*-jdoc$") -# list(APPEND documented_java_files "${CMAKE_CURRENT_BINARY_DIR}/${java_file_name}-jdoc.java") -# endif() -#endforeach() - -#add_custom_command( -# TARGET ${api_target} PRE_BUILD -# COMMAND ${PYTHON_EXECUTABLE} "${GEN_JAVADOC}" "${CMAKE_CURRENT_SOURCE_DIR}/src/java" "${CMAKE_CURRENT_BINARY_DIR}" 2>"${CMAKE_CURRENT_BINARY_DIR}/get_javadoc_errors.log" -# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -# DEPENDS ${java_project_files} -# DEPENDS ${generated_java_sources} -# DEPENDS "${GEN_JAVA}" -# DEPENDS "${HDR_PARSER}" -# DEPENDS "${GEN_JAVADOC}" -# DEPENDS "${RST_PARSER}" -#) - - -#SET(JAVA_OUTPUT_DIR "${CMAKE_BINARY_DIR}/src/org/opencv") - -#foreach(java_file ${documented_java_files}) -# get_filename_component(java_file_name "${java_file}" NAME) -# string(REPLACE "-jdoc.java" ".java" java_file_name "${java_file_name}") -# string(REPLACE "+" "/" java_file_name "${java_file_name}") -# -# add_custom_command( -# TARGET ${api_target} -# COMMAND ${CMAKE_COMMAND} -E copy "${java_file}" "${JAVA_OUTPUT_DIR}/${java_file_name}" -# DEPENDS "${java_file}" -# DEPENDS "${JAVA_OUTPUT_DIR}" -# COMMENT "Generating src/org/opencv/${java_file_name}" -# ) -# LIST(APPEND additional_clean_files "${JAVA_OUTPUT_DIR}/${java_file_name}") -# if(ANDROID) -# get_filename_component(install_dir "${java_file_name}" PATH) -# install(FILES "${JAVA_OUTPUT_DIR}/${java_file_name}" DESTINATION src/org/opencv/${install_dir} COMPONENT main) -# endif() -#endforeach() - #android test project if(ANDROID AND BUILD_TESTS AND CAN_BUILD_ANDROID_PROJECTS) file(COPY android_test DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" diff --git a/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/puzzle15View.java b/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/puzzle15View.java index f23bf33c1..9bb2bc99e 100644 --- a/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/puzzle15View.java +++ b/samples/android/15-puzzle/src/org/opencv/samples/puzzle15/puzzle15View.java @@ -1,6 +1,6 @@ package org.opencv.samples.puzzle15; -import org.opencv.android; +import org.opencv.Android; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Size; @@ -137,7 +137,7 @@ public class puzzle15View extends SampleCvViewBase implements OnTouchListener { drawGrid(cols, rows); Bitmap bmp = Bitmap.createBitmap(cols, rows, Bitmap.Config.ARGB_8888); - if (android.MatToBitmap(mRgba15, bmp)) + if (Android.MatToBitmap(mRgba15, bmp)) return bmp; bmp.recycle(); diff --git a/samples/android/CMakeLists.txt b/samples/android/CMakeLists.txt index 9a389cfb8..e211299c9 100644 --- a/samples/android/CMakeLists.txt +++ b/samples/android/CMakeLists.txt @@ -33,7 +33,7 @@ if (BUILD_ANDROID_EXAMPLES) SET(sample_dir "${CMAKE_CURRENT_BINARY_DIR}/${sample}") add_custom_target(${sample} ALL) - add_dependencies(${sample} opencv_java opencv_java_api) + add_dependencies(${sample} opencv_java) set_target_properties(${sample} PROPERTIES PROJECT_LABEL "(ANDROID EXAMPLE) ${sample}") diff --git a/samples/android/face-detection/src/org/opencv/samples/fd/FdView.java b/samples/android/face-detection/src/org/opencv/samples/fd/FdView.java index a544f4caf..54e52686a 100644 --- a/samples/android/face-detection/src/org/opencv/samples/fd/FdView.java +++ b/samples/android/face-detection/src/org/opencv/samples/fd/FdView.java @@ -7,7 +7,7 @@ import java.io.InputStream; import java.util.LinkedList; import java.util.List; -import org.opencv.android; +import org.opencv.Android; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Rect; @@ -91,7 +91,7 @@ class FdView extends SampleCvViewBase { Bitmap bmp = Bitmap.createBitmap(mRgba.cols(), mRgba.rows(), Bitmap.Config.ARGB_8888); - if (android.MatToBitmap(mRgba, bmp)) + if (Android.MatToBitmap(mRgba, bmp)) return bmp; bmp.recycle(); @@ -113,4 +113,4 @@ class FdView extends SampleCvViewBase { mGray = null; } } -} \ No newline at end of file +} diff --git a/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsView.java b/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsView.java index 628d41bef..8b7e2a855 100644 --- a/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsView.java +++ b/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsView.java @@ -1,6 +1,6 @@ package org.opencv.samples.imagemanipulations; -import org.opencv.android; +import org.opencv.Android; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Size; @@ -135,7 +135,7 @@ class ImageManipulationsView extends SampleCvViewBase { Bitmap bmp = Bitmap.createBitmap(mRgba.cols(), mRgba.rows(), Bitmap.Config.ARGB_8888); - if (android.MatToBitmap(mRgba, bmp)) + if (Android.MatToBitmap(mRgba, bmp)) return bmp; bmp.recycle(); @@ -175,4 +175,4 @@ class ImageManipulationsView extends SampleCvViewBase { mZoomWindow = null; } } -} \ No newline at end of file +} diff --git a/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1View.java b/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1View.java index e6a3bd7b2..206b5b5c9 100644 --- a/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1View.java +++ b/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/Sample1View.java @@ -1,6 +1,6 @@ package org.opencv.samples.tutorial1; -import org.opencv.android; +import org.opencv.Android; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Point; @@ -56,7 +56,7 @@ class Sample1View extends SampleViewBase { Bitmap bmp = Bitmap.createBitmap(getFrameWidth(), getFrameHeight(), Bitmap.Config.ARGB_8888); - if (android.MatToBitmap(mRgba, bmp)) + if (Android.MatToBitmap(mRgba, bmp)) return bmp; bmp.recycle(); @@ -84,4 +84,4 @@ class Sample1View extends SampleViewBase { mIntermediateMat = null; } } -} \ No newline at end of file +} diff --git a/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2View.java b/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2View.java index d4f70acbe..83a69050d 100644 --- a/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2View.java +++ b/samples/android/tutorial-2-opencvcamera/src/org/opencv/samples/tutorial2/Sample2View.java @@ -1,6 +1,6 @@ package org.opencv.samples.tutorial2; -import org.opencv.android; +import org.opencv.Android; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Point; @@ -54,7 +54,7 @@ class Sample2View extends SampleCvViewBase { Bitmap bmp = Bitmap.createBitmap(mRgba.cols(), mRgba.rows(), Bitmap.Config.ARGB_8888); - if (android.MatToBitmap(mRgba, bmp)) + if (Android.MatToBitmap(mRgba, bmp)) return bmp; bmp.recycle(); @@ -79,4 +79,4 @@ class Sample2View extends SampleCvViewBase { mIntermediateMat = null; } } -} \ No newline at end of file +} diff --git a/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4View.java b/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4View.java index 5c270a888..2a0f72b37 100644 --- a/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4View.java +++ b/samples/android/tutorial-4-mixed/src/org/opencv/samples/tutorial4/Sample4View.java @@ -1,6 +1,6 @@ package org.opencv.samples.tutorial4; -import org.opencv.android; +import org.opencv.Android; import org.opencv.core.Mat; import org.opencv.core.CvType; import org.opencv.imgproc.Imgproc; @@ -56,7 +56,7 @@ class Sample4View extends SampleViewBase { Bitmap bmp = Bitmap.createBitmap(getFrameWidth(), getFrameHeight(), Bitmap.Config.ARGB_8888); - if (android.MatToBitmap(mRgba, bmp)) + if (Android.MatToBitmap(mRgba, bmp)) return bmp; bmp.recycle(); @@ -90,4 +90,4 @@ class Sample4View extends SampleViewBase { static { System.loadLibrary("mixed_sample"); } -} \ No newline at end of file +}