Commit 78ee81c4 authored by Andrey Kamaev's avatar Andrey Kamaev

Fixed dependency from opencv_nonfree in Java bindings

parent f6bddd23
......@@ -6,7 +6,7 @@ if(NOT ANDROID OR NOT PYTHON_EXECUTABLE OR ANDROID_NATIVE_API_LEVEL LESS 8)
endif()
set(the_description "The java bindings")
ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_highgui opencv_ml opencv_calib3d opencv_photo)
ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_highgui opencv_ml opencv_calib3d opencv_photo opencv_nonfree)
ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/cpp")
# get list of modules to wrap
......@@ -56,6 +56,7 @@ foreach(module ${OPENCV_JAVA_MODULES})
endforeach()
# first run (to get list of generated files)
if(module_headers)
file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out/")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out")
execute_process(COMMAND ${PYTHON_EXECUTABLE} "${GEN_JAVA}" "${HDR_PARSER}" ${module} ${module_headers}
......@@ -73,6 +74,7 @@ foreach(module ${OPENCV_JAVA_MODULES})
list(APPEND java_hdr_deps ${module_headers})
list(APPEND generated_cpp_sources "${CMAKE_CURRENT_BINARY_DIR}/${module}.cpp")
list(APPEND generated_java_sources ${${module}_generated_java_sources})
endif()
endforeach()
# get handwritten files used for wrappers generation
......
......@@ -22,3 +22,15 @@ JNI_OnUnload(JavaVM *vm, void *reserved)
}
} // extern "C"
#include "opencv2/opencv_modules.hpp"
#if HAVE_OPENCV_MODULES_NONFREE
#include "opencv2/nonfree/nonfree.hpp"
static bool makeUseOfNonfree = initModule_nonfree();
#endif
#if HAVE_OPENCV_MODULES_FEATURES2D
#include "opencv2/features2d/features2d.hpp"
static bool makeUseOfNonfree = initModule_features2d();
#endif
\ No newline at end of file
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