parent
0cad2d2a83
commit
8533b45ce9
45 changed files with 917 additions and 850 deletions
@ -0,0 +1,14 @@ |
|||||||
|
// these constants are wrapped inside functions to prevent inlining |
||||||
|
private static String getVersion() { return "@OPENCV_VERSION@"; } |
||||||
|
private static String getNativeLibraryName() { return "opencv_java@OPENCV_VERSION_MAJOR@@OPENCV_VERSION_MINOR@@OPENCV_VERSION_PATCH@"; } |
||||||
|
private static int getVersionMajor() { return @OPENCV_VERSION_MAJOR@; } |
||||||
|
private static int getVersionMinor() { return @OPENCV_VERSION_MINOR@; } |
||||||
|
private static int getVersionRevision() { return @OPENCV_VERSION_PATCH@; } |
||||||
|
private static String getVersionStatus() { return "@OPENCV_VERSION_STATUS@"; } |
||||||
|
|
||||||
|
public static final String VERSION = getVersion(); |
||||||
|
public static final String NATIVE_LIBRARY_NAME = getNativeLibraryName(); |
||||||
|
public static final int VERSION_MAJOR = getVersionMajor(); |
||||||
|
public static final int VERSION_MINOR = getVersionMinor(); |
||||||
|
public static final int VERSION_REVISION = getVersionRevision(); |
||||||
|
public static final String VERSION_STATUS = getVersionStatus(); |
@ -0,0 +1,88 @@ |
|||||||
|
if(NOT ANDROID_EXECUTABLE) |
||||||
|
message(WARNING "'android' tool required to build Android SDK") |
||||||
|
return() |
||||||
|
endif() |
||||||
|
ocv_assert(ANDROID_TOOLS_Pkg_Revision GREATER 13) |
||||||
|
|
||||||
|
project(${the_module}_android) |
||||||
|
|
||||||
|
set(OPENCV_JAVA_DIR "${OpenCV_BINARY_DIR}/android_sdk" CACHE INTERNAL "") |
||||||
|
set(OPENCV_ANDROID_LIB_DIR "${OPENCV_JAVA_DIR}" CACHE INTERNAL "") # for OpenCV samples |
||||||
|
|
||||||
|
file(REMOVE_RECURSE "${OPENCV_JAVA_DIR}") |
||||||
|
file(MAKE_DIRECTORY "${OPENCV_JAVA_DIR}/bin") |
||||||
|
set(java_src_dir "${OPENCV_JAVA_DIR}/src") |
||||||
|
file(MAKE_DIRECTORY "${java_src_dir}") |
||||||
|
|
||||||
|
ocv_copyfiles_append_dir(JAVA_SRC_COPY "${OPENCV_JAVA_BINDINGS_DIR}/gen/java" "${java_src_dir}") |
||||||
|
ocv_copyfiles_append_dir(JAVA_SRC_COPY "${OPENCV_JAVA_BINDINGS_DIR}/gen/android/java" "${java_src_dir}") |
||||||
|
|
||||||
|
# calc default SDK Target |
||||||
|
android_get_compatible_target(android_sdk_target ${ANDROID_NATIVE_API_LEVEL} ${ANDROID_SDK_TARGET} 14) |
||||||
|
string(REGEX REPLACE "android-" "" android_sdk_target_num ${android_sdk_target}) |
||||||
|
if( (ANDROID_SDK_TARGET AND ANDROID_SDK_TARGET LESS 21) OR (android_sdk_target_num LESS 21) ) |
||||||
|
message(STATUS "[OpenCV for Android SDK]: A new OpenGL Camera Bridge (CameraGLSurfaceView, CameraGLRendererBase, CameraRenderer, Camera2Renderer) is disabled, because ANDROID_SDK_TARGET (${android_sdk_target_num}) < 21") |
||||||
|
else() |
||||||
|
ocv_copyfiles_append_dir(JAVA_SRC_COPY "${OPENCV_JAVA_BINDINGS_DIR}/gen/android-21/java" "${java_src_dir}") |
||||||
|
endif() |
||||||
|
|
||||||
|
# copy boilerplate |
||||||
|
file(GLOB_RECURSE seed_project_files_rel RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/" "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/*") |
||||||
|
list(REMOVE_ITEM seed_project_files_rel "${ANDROID_MANIFEST_FILE}") |
||||||
|
foreach(file ${seed_project_files_rel}) |
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/android_lib/${file}" "${OPENCV_JAVA_DIR}/${file}" @ONLY) |
||||||
|
list(APPEND depends "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/${file}") |
||||||
|
get_filename_component(install_subdir "${file}" PATH) |
||||||
|
install(FILES "${OPENCV_JAVA_DIR}/${file}" DESTINATION "${JAVA_INSTALL_ROOT}/${install_subdir}" COMPONENT java) |
||||||
|
endforeach() |
||||||
|
|
||||||
|
list(APPEND depends gen_opencv_java_source "${OPENCV_DEPHELPER}/gen_opencv_java_source") |
||||||
|
ocv_copyfiles_add_target(${the_module}_android_source_copy JAVA_SRC_COPY "Copy Java(Andoid SDK) source files" ${depends}) |
||||||
|
file(REMOVE "${OPENCV_DEPHELPER}/${the_module}_android_source_copy") # force rebuild after CMake run |
||||||
|
|
||||||
|
set(depends ${the_module}_android_source_copy "${OPENCV_DEPHELPER}/${the_module}_android_source_copy") |
||||||
|
|
||||||
|
# generate Android library project |
||||||
|
set(android_sdk_project_files ${ANDROID_LIB_PROJECT_FILES}) # build.xml;local.properties;proguard-project.txt;project.properties |
||||||
|
ocv_list_add_prefix(android_sdk_project_files "${OPENCV_JAVA_DIR}/") |
||||||
|
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/android_lib/${ANDROID_MANIFEST_FILE}" "${CMAKE_CURRENT_BINARY_DIR}/${ANDROID_MANIFEST_FILE}" @ONLY) |
||||||
|
|
||||||
|
add_custom_command( |
||||||
|
OUTPUT ${android_sdk_project_files} "${OPENCV_JAVA_DIR}/${ANDROID_MANIFEST_FILE}" |
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove ${android_sdk_project_files} |
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_BINARY_DIR}/${ANDROID_MANIFEST_FILE}" "${OPENCV_JAVA_DIR}/${ANDROID_MANIFEST_FILE}" |
||||||
|
COMMAND ${ANDROID_EXECUTABLE} --silent create lib-project --path \"${OPENCV_JAVA_DIR}\" --target \"${android_sdk_target}\" --name OpenCV --package org.opencv 2>\"${CMAKE_CURRENT_BINARY_DIR}/create_lib_project.log\" |
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_BINARY_DIR}/${ANDROID_MANIFEST_FILE}" "${OPENCV_JAVA_DIR}/${ANDROID_MANIFEST_FILE}" |
||||||
|
WORKING_DIRECTORY "${OPENCV_JAVA_DIR}" |
||||||
|
MAIN_DEPENDENCY "${CMAKE_CURRENT_BINARY_DIR}/${ANDROID_MANIFEST_FILE}" |
||||||
|
DEPENDS ${depends} |
||||||
|
COMMENT "Generating OpenCV Android library project. SDK target: ${lib_target_sdk_target}" |
||||||
|
) |
||||||
|
list(APPEND depends ${android_sdk_project_files} "${OPENCV_JAVA_DIR}/${ANDROID_MANIFEST_FILE}") |
||||||
|
|
||||||
|
install(DIRECTORY "${OPENCV_JAVA_DIR}/src" DESTINATION "${JAVA_INSTALL_ROOT}" COMPONENT java) |
||||||
|
install(FILES "${OPENCV_JAVA_DIR}/${ANDROID_PROJECT_PROPERTIES_FILE}" DESTINATION ${JAVA_INSTALL_ROOT} COMPONENT java) |
||||||
|
install(FILES "${OPENCV_JAVA_DIR}/${ANDROID_MANIFEST_FILE}" DESTINATION ${JAVA_INSTALL_ROOT} COMPONENT java) |
||||||
|
|
||||||
|
# build jar |
||||||
|
set(JAR_FILE "${OpenCV_BINARY_DIR}/bin/classes.jar") |
||||||
|
# build the library project |
||||||
|
# normally we should do this after a native part, but for a library project we can build the java part first |
||||||
|
add_custom_command( |
||||||
|
OUTPUT "${JAR_FILE}" "${OPENCV_DEPHELPER}/${the_module}_android" |
||||||
|
COMMAND ${ANT_EXECUTABLE} -q -noinput -k debug -Djava.target=1.6 -Djava.source=1.6 |
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch "${OPENCV_DEPHELPER}/${the_module}_android" |
||||||
|
WORKING_DIRECTORY "${OPENCV_JAVA_DIR}" |
||||||
|
DEPENDS ${depends} |
||||||
|
COMMENT "Building OpenCV Android library project" |
||||||
|
) |
||||||
|
|
||||||
|
add_custom_target(${the_module}_android DEPENDS "${OPENCV_DEPHELPER}/${the_module}_android" SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/${ANDROID_MANIFEST_FILE}") |
||||||
|
add_dependencies(${the_module} ${the_module}_android) |
||||||
|
|
||||||
|
# empty 'gen' and 'res' folders |
||||||
|
install(CODE " |
||||||
|
FILE(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${JAVA_INSTALL_ROOT}/gen\") |
||||||
|
FILE(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${JAVA_INSTALL_ROOT}/res\") |
||||||
|
" COMPONENT java) |
@ -1,15 +0,0 @@ |
|||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS) |
|
||||||
|
|
||||||
include OpenCV.mk |
|
||||||
|
|
||||||
LOCAL_MODULE := opencv_java
|
|
||||||
|
|
||||||
MY_PREFIX := $(LOCAL_PATH)
|
|
||||||
MY_SOURCES := $(wildcard $(MY_PREFIX)/*.cpp)
|
|
||||||
LOCAL_SRC_FILES := $(MY_SOURCES:$(MY_PREFIX)%=%)
|
|
||||||
|
|
||||||
LOCAL_LDLIBS += -llog -ldl -ljnigraphics
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY) |
|
@ -1,3 +0,0 @@ |
|||||||
APP_STL := gnustl_static
|
|
||||||
APP_CPPFLAGS := -frtti -fexceptions
|
|
||||||
APP_ABI := armeabi-v7a
|
|
@ -0,0 +1,16 @@ |
|||||||
|
if(ANDROID) |
||||||
|
ocv_update(OPENCV_JAVA_LIB_NAME_SUFFIX "${OPENCV_VERSION_MAJOR}") |
||||||
|
ocv_update(JAVA_INSTALL_ROOT "sdk/java") |
||||||
|
else() |
||||||
|
ocv_update(OPENCV_JAVA_LIB_NAME_SUFFIX "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}") |
||||||
|
endif() |
||||||
|
|
||||||
|
# get list of modules to wrap |
||||||
|
# message(STATUS "Wrapped in java:") |
||||||
|
set(OPENCV_JAVA_MODULES) |
||||||
|
foreach(m ${OPENCV_MODULES_BUILD}) |
||||||
|
if (";${OPENCV_MODULE_${m}_WRAPPERS};" MATCHES ";java;" AND HAVE_${m}) |
||||||
|
list(APPEND OPENCV_JAVA_MODULES ${m}) |
||||||
|
#message(STATUS "\t${m}") |
||||||
|
endif() |
||||||
|
endforeach() |
@ -0,0 +1,103 @@ |
|||||||
|
set(MODULE_NAME "java_bindings_generator") |
||||||
|
set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE) |
||||||
|
ocv_add_module(${MODULE_NAME} INTERNAL) |
||||||
|
|
||||||
|
set(OPENCV_JAVA_SIGNATURES_FILE "${CMAKE_CURRENT_BINARY_DIR}/opencv_java_signatures.json" CACHE INTERNAL "") |
||||||
|
set(OPENCV_JAVA_BINDINGS_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") |
||||||
|
|
||||||
|
file(REMOVE_RECURSE "${OPENCV_JAVA_BINDINGS_DIR}/gen") |
||||||
|
file(REMOVE "${OPENCV_DEPHELPER}/gen_opencv_java_source") # force re-run after CMake |
||||||
|
|
||||||
|
# This file is included from a subdirectory |
||||||
|
set(JAVA_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") |
||||||
|
include(${JAVA_SOURCE_DIR}/common.cmake) |
||||||
|
|
||||||
|
set(__remap_config "") # list of remapped ".in" files (configure_file) |
||||||
|
set(__remap_targets "") |
||||||
|
|
||||||
|
macro(ocv_remap_files files_list_var) |
||||||
|
set(target_dir "${OpenCV_BINARY_DIR}/configured") |
||||||
|
foreach(f ${${files_list_var}}) |
||||||
|
if(NOT "${f}" MATCHES "^(.*)\\.in$") |
||||||
|
continue() |
||||||
|
endif() |
||||||
|
set(f_ "${CMAKE_MATCH_1}") |
||||||
|
file(RELATIVE_PATH rel_path0 "${OpenCV_SOURCE_DIR}" "${f}") |
||||||
|
file(RELATIVE_PATH rel_path1 "${OpenCV_SOURCE_DIR}" "${f_}") |
||||||
|
set(__target_file "${target_dir}/${rel_path1}") |
||||||
|
configure_file("${f}" "${__target_file}" @ONLY) |
||||||
|
if(__remap_config) |
||||||
|
set(__remap_config "${__remap_config},\n") |
||||||
|
endif() |
||||||
|
set(__remap_config "${__remap_config} { \"src\": \"${rel_path0}\", \"target\": \"${__target_file}\" }") |
||||||
|
list(APPEND __remap_targets "${__target_file}") |
||||||
|
endforeach() |
||||||
|
endmacro() |
||||||
|
|
||||||
|
# common files |
||||||
|
file(GLOB_RECURSE deps "${CMAKE_CURRENT_SOURCE_DIR}/src/*" "${CMAKE_CURRENT_SOURCE_DIR}/android*/*" "${CMAKE_CURRENT_SOURCE_DIR}/templates/*") |
||||||
|
ocv_remap_files(deps) |
||||||
|
|
||||||
|
set(__modules_config "") # list of OpenCV modules |
||||||
|
foreach(m ${OPENCV_JAVA_MODULES}) |
||||||
|
set(module_java_dir "${OPENCV_MODULE_${m}_LOCATION}/misc/java") |
||||||
|
list(APPEND deps ${OPENCV_MODULE_${m}_HEADERS}) |
||||||
|
file(GLOB_RECURSE misc_files "${module_java_dir}/*") |
||||||
|
list(APPEND deps ${misc_files}) |
||||||
|
|
||||||
|
string(REGEX REPLACE "^opencv_" "" m_ "${m}") |
||||||
|
if(__modules_config) |
||||||
|
set(__modules_config "${__modules_config},\n") |
||||||
|
endif() |
||||||
|
file(RELATIVE_PATH rel_path "${OpenCV_SOURCE_DIR}" "${OPENCV_MODULE_${m}_LOCATION}") |
||||||
|
set(__modules_config "${__modules_config} { \"name\": \"${m_}\", \"location\": \"${rel_path}\" }") |
||||||
|
|
||||||
|
ocv_remap_files(misc_files) |
||||||
|
endforeach(m) |
||||||
|
|
||||||
|
set(CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/gen_java.json") |
||||||
|
set(__config_str "\ |
||||||
|
{ |
||||||
|
\"rootdir\": \"${OpenCV_SOURCE_DIR}\", |
||||||
|
\"modules\": [ |
||||||
|
${__modules_config} |
||||||
|
], |
||||||
|
\"files_remap\": [ |
||||||
|
${__remap_config} |
||||||
|
] |
||||||
|
} |
||||||
|
") |
||||||
|
if(EXISTS "${CONFIG_FILE}") |
||||||
|
file(READ "${CONFIG_FILE}" __content) |
||||||
|
else() |
||||||
|
set(__content "") |
||||||
|
endif() |
||||||
|
if(NOT "${__content}" STREQUAL "${__config_str}") |
||||||
|
file(WRITE "${CONFIG_FILE}" "${__config_str}") |
||||||
|
file(REMOVE "${OPENCV_DEPHELPER}/gen_opencv_java_source") |
||||||
|
endif() |
||||||
|
unset(__config_str) |
||||||
|
|
||||||
|
set(java_generated_files |
||||||
|
# "${OPENCV_JAVA_SIGNATURES_FILE}" |
||||||
|
"${OPENCV_DEPHELPER}/gen_opencv_java_source" |
||||||
|
) |
||||||
|
|
||||||
|
add_custom_command( |
||||||
|
OUTPUT ${java_generated_files} |
||||||
|
COMMAND ${PYTHON_DEFAULT_EXECUTABLE} "${JAVA_SOURCE_DIR}/generator/gen_java.py" -p "${JAVA_SOURCE_DIR}/../python/src2/gen2.py" -c "${CONFIG_FILE}" |
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch "${OPENCV_DEPHELPER}/gen_opencv_java_source" |
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" |
||||||
|
DEPENDS "${JAVA_SOURCE_DIR}/generator/gen_java.py" |
||||||
|
"${JAVA_SOURCE_DIR}/../python/src2/gen2.py" |
||||||
|
"${JAVA_SOURCE_DIR}/../python/src2/hdr_parser.py" |
||||||
|
# don't, result of file(WRITE): "${CMAKE_CURRENT_BINARY_DIR}/gen_java.json" |
||||||
|
${deps} ${__remap_targets} |
||||||
|
# not allowed (file(WRITE) result): "${CONFIG_FILE}" |
||||||
|
COMMENT "Generate files for Java bindings" |
||||||
|
) |
||||||
|
|
||||||
|
add_custom_target(gen_opencv_java_source DEPENDS ${java_generated_files} |
||||||
|
SOURCES "${JAVA_SOURCE_DIR}/generator/gen_java.py" |
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/gen_java.json" |
||||||
|
) |
@ -0,0 +1,8 @@ |
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html
|
||||||
|
|
||||||
|
#include "common.h" |
||||||
|
|
||||||
|
// Include all generated JNI code
|
||||||
|
#include "opencv_jni.hpp" |
@ -0,0 +1,52 @@ |
|||||||
|
// |
||||||
|
// This file is auto-generated. Please don't modify it! |
||||||
|
// |
||||||
|
|
||||||
|
#undef LOG_TAG |
||||||
|
|
||||||
|
#include "opencv2/opencv_modules.hpp" |
||||||
|
#ifdef HAVE_OPENCV_$M |
||||||
|
|
||||||
|
#include <string> |
||||||
|
|
||||||
|
#include "opencv2/$m.hpp" |
||||||
|
|
||||||
|
$includes |
||||||
|
|
||||||
|
#define LOG_TAG "org.opencv.$m" |
||||||
|
#include "common.h" |
||||||
|
|
||||||
|
using namespace cv; |
||||||
|
|
||||||
|
/// throw java exception |
||||||
|
#undef throwJavaException |
||||||
|
#define throwJavaException throwJavaException_$m |
||||||
|
static void throwJavaException(JNIEnv *env, const std::exception *e, const char *method) { |
||||||
|
std::string what = "unknown exception"; |
||||||
|
jclass je = 0; |
||||||
|
|
||||||
|
if(e) { |
||||||
|
std::string exception_type = "std::exception"; |
||||||
|
|
||||||
|
if(dynamic_cast<const cv::Exception*>(e)) { |
||||||
|
exception_type = "cv::Exception"; |
||||||
|
je = env->FindClass("org/opencv/core/CvException"); |
||||||
|
} |
||||||
|
|
||||||
|
what = exception_type + ": " + e->what(); |
||||||
|
} |
||||||
|
|
||||||
|
if(!je) je = env->FindClass("java/lang/Exception"); |
||||||
|
env->ThrowNew(je, what.c_str()); |
||||||
|
|
||||||
|
LOGE("%s caught %s", method, what.c_str()); |
||||||
|
(void)method; // avoid "unused" warning |
||||||
|
} |
||||||
|
|
||||||
|
extern "C" { |
||||||
|
|
||||||
|
$code |
||||||
|
|
||||||
|
} // extern "C" |
||||||
|
|
||||||
|
#endif // HAVE_OPENCV_$M |
@ -0,0 +1,15 @@ |
|||||||
|
// |
||||||
|
// This file is auto-generated. Please don't modify it! |
||||||
|
// |
||||||
|
package org.opencv.$module; |
||||||
|
|
||||||
|
$imports |
||||||
|
|
||||||
|
$docs |
||||||
|
$annotation |
||||||
|
public class $jname { |
||||||
|
|
||||||
|
protected final long nativeObj; |
||||||
|
protected $jname(long addr) { nativeObj = addr; } |
||||||
|
|
||||||
|
public long getNativeObjAddr() { return nativeObj; } |
@ -0,0 +1,12 @@ |
|||||||
|
// |
||||||
|
// This file is auto-generated. Please don't modify it! |
||||||
|
// |
||||||
|
package org.opencv.$module; |
||||||
|
|
||||||
|
$imports |
||||||
|
|
||||||
|
$docs |
||||||
|
$annotation |
||||||
|
public class $jname extends $base { |
||||||
|
|
||||||
|
protected $jname(long addr) { super(addr); } |
@ -0,0 +1,10 @@ |
|||||||
|
// |
||||||
|
// This file is auto-generated. Please don't modify it! |
||||||
|
// |
||||||
|
package org.opencv.$module; |
||||||
|
|
||||||
|
$imports |
||||||
|
|
||||||
|
$docs |
||||||
|
$annotation |
||||||
|
public class $jname { |
@ -0,0 +1,53 @@ |
|||||||
|
project(${the_module}_jar) |
||||||
|
|
||||||
|
set(OPENCV_JAVA_DIR "${CMAKE_CURRENT_BINARY_DIR}/opencv" CACHE INTERNAL "") |
||||||
|
|
||||||
|
file(REMOVE_RECURSE "${OPENCV_JAVA_DIR}") |
||||||
|
file(REMOVE "${OPENCV_DEPHELPER}/${the_module}_jar_source_copy") |
||||||
|
|
||||||
|
file(MAKE_DIRECTORY "${OPENCV_JAVA_DIR}/build/classes") |
||||||
|
set(java_src_dir "${OPENCV_JAVA_DIR}/java") |
||||||
|
file(MAKE_DIRECTORY "${java_src_dir}") |
||||||
|
|
||||||
|
set(JAR_NAME opencv-${OPENCV_JAVA_LIB_NAME_SUFFIX}.jar) |
||||||
|
set(OPENCV_JAR_FILE "${OpenCV_BINARY_DIR}/bin/${JAR_NAME}" CACHE INTERNAL "") |
||||||
|
|
||||||
|
ocv_copyfiles_append_dir(JAVA_SRC_COPY "${OPENCV_JAVA_BINDINGS_DIR}/gen/java" "${java_src_dir}") |
||||||
|
|
||||||
|
set(depends gen_opencv_java_source "${OPENCV_DEPHELPER}/gen_opencv_java_source") |
||||||
|
ocv_copyfiles_add_target(${the_module}_jar_source_copy JAVA_SRC_COPY "Copy Java(JAR) source files" ${depends}) |
||||||
|
set(depends ${the_module}_jar_source_copy "${OPENCV_DEPHELPER}/${the_module}_jar_source_copy") |
||||||
|
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build.xml.in" "${OPENCV_JAVA_DIR}/build.xml" @ONLY) |
||||||
|
list(APPEND depends "${OPENCV_JAVA_DIR}/build.xml") |
||||||
|
|
||||||
|
add_custom_command(OUTPUT "${OPENCV_DEPHELPER}/${the_module}_jar" |
||||||
|
COMMAND ${ANT_EXECUTABLE} -noinput -k jar |
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch "${OPENCV_DEPHELPER}/${the_module}_jar" |
||||||
|
WORKING_DIRECTORY "${OPENCV_JAVA_DIR}" |
||||||
|
DEPENDS ${depends} |
||||||
|
COMMENT "Generating ${JAR_NAME}" |
||||||
|
) |
||||||
|
add_custom_target(${the_module}_jar DEPENDS "${OPENCV_DEPHELPER}/${the_module}_jar") |
||||||
|
|
||||||
|
add_custom_command(OUTPUT "${OPENCV_DEPHELPER}/${the_module}doc" |
||||||
|
COMMAND ${ANT_EXECUTABLE} -noinput -k javadoc |
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch "${OPENCV_DEPHELPER}/${the_module}doc" |
||||||
|
WORKING_DIRECTORY "${OPENCV_JAVA_DIR}" |
||||||
|
DEPENDS ${depends} |
||||||
|
COMMENT "Generating Javadoc" |
||||||
|
) |
||||||
|
add_custom_target(${the_module}doc DEPENDS "${OPENCV_DEPHELPER}/${the_module}doc") |
||||||
|
|
||||||
|
install(FILES ${OPENCV_JAR_FILE} OPTIONAL DESTINATION ${OPENCV_JAR_INSTALL_PATH} COMPONENT java) |
||||||
|
|
||||||
|
add_dependencies(${the_module} ${the_module}_jar) |
||||||
|
|
||||||
|
if(BUILD_DOCS) |
||||||
|
add_dependencies(opencv_docs ${the_module}doc) |
||||||
|
|
||||||
|
install(DIRECTORY ${OpenCV_BINARY_DIR}/doc/javadoc |
||||||
|
DESTINATION "${OPENCV_DOC_INSTALL_PATH}/javadoc" |
||||||
|
COMPONENT "docs" OPTIONAL |
||||||
|
) |
||||||
|
endif() |
@ -0,0 +1,90 @@ |
|||||||
|
project(${the_module}) |
||||||
|
|
||||||
|
glob_more_specific_sources(H "${CMAKE_CURRENT_SOURCE_DIR}/../generator/src" handwritten_h_sources) |
||||||
|
glob_more_specific_sources(CPP "${CMAKE_CURRENT_SOURCE_DIR}/../generator/src" handwritten_cpp_sources) |
||||||
|
|
||||||
|
# grab C++ files from misc/java |
||||||
|
foreach(m ${OPENCV_MODULES_BUILD}) |
||||||
|
if (";${OPENCV_MODULE_${m}_WRAPPERS};" MATCHES ";java;" AND HAVE_${m}) |
||||||
|
set(module_java_dir "${OPENCV_MODULE_${m}_LOCATION}/misc/java") |
||||||
|
include_directories("${module_java_dir}/src/cpp") |
||||||
|
file(GLOB _result "${module_java_dir}/src/cpp/*.h" "${module_java_dir}/src/cpp/*.hpp" "${module_java_dir}/src/cpp/*.cpp") |
||||||
|
list(APPEND handwritten_cpp_sources ${_result}) |
||||||
|
endif() |
||||||
|
endforeach() |
||||||
|
|
||||||
|
set(__type MODULE) |
||||||
|
if(BUILD_FAT_JAVA_LIB) |
||||||
|
set(__type SHARED) # samples link to libopencv_java |
||||||
|
endif() |
||||||
|
ocv_add_library(${the_module} ${__type} |
||||||
|
${handwritten_h_sources} ${handwritten_cpp_sources} ${generated_cpp_sources} |
||||||
|
${copied_files} |
||||||
|
) |
||||||
|
add_dependencies(${the_module} gen_opencv_java_source) |
||||||
|
|
||||||
|
ocv_target_include_directories(${the_module} "${CMAKE_CURRENT_SOURCE_DIR}/../generator/src/cpp") |
||||||
|
ocv_target_include_directories(${the_module} "${OPENCV_JAVA_BINDINGS_DIR}/gen/cpp") |
||||||
|
ocv_target_include_modules(${the_module} ${OPENCV_MODULE_${the_module}_DEPS}) |
||||||
|
if(NOT ANDROID) |
||||||
|
ocv_target_include_directories(${the_module} SYSTEM ${JNI_INCLUDE_DIRS}) |
||||||
|
endif() |
||||||
|
|
||||||
|
set(__deps ${OPENCV_MODULE_${the_module}_DEPS}) |
||||||
|
list(REMOVE_ITEM __deps opencv_java_bindings_generator) # don't add dummy module to target_link_libraries list |
||||||
|
|
||||||
|
if(BUILD_FAT_JAVA_LIB) |
||||||
|
ocv_list_unique(__deps) |
||||||
|
set(__extradeps ${__deps}) |
||||||
|
ocv_list_filterout(__extradeps "^opencv_") |
||||||
|
if(__extradeps) |
||||||
|
list(REMOVE_ITEM __deps ${__extradeps}) |
||||||
|
endif() |
||||||
|
if(APPLE) |
||||||
|
foreach(_dep ${__deps}) |
||||||
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE -Wl,-force_load "${_dep}") |
||||||
|
endforeach() |
||||||
|
elseif(((CMAKE_COMPILER_IS_GNUCXX OR UNIX) OR (OPENCV_FORCE_FAT_JAVA_LIB_LD_RULES)) AND (NOT OPENCV_SKIP_FAT_JAVA_LIB_LD_RULES)) |
||||||
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE -Wl,-whole-archive ${__deps} -Wl,-no-whole-archive) |
||||||
|
else() |
||||||
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${__deps}) |
||||||
|
endif() |
||||||
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${__extradeps} ${OPENCV_LINKER_LIBS}) |
||||||
|
else() |
||||||
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${__deps} ${OPENCV_LINKER_LIBS}) |
||||||
|
endif() |
||||||
|
|
||||||
|
# Additional target properties |
||||||
|
set_target_properties(${the_module} PROPERTIES |
||||||
|
OUTPUT_NAME "${the_module}${OPENCV_JAVA_LIB_NAME_SUFFIX}" |
||||||
|
ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} |
||||||
|
LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} |
||||||
|
RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} |
||||||
|
DEFINE_SYMBOL CVAPI_EXPORTS |
||||||
|
) |
||||||
|
|
||||||
|
if(ANDROID) |
||||||
|
ocv_target_link_libraries(${the_module} LINK_PUBLIC jnigraphics) # for Mat <=> Bitmap converters |
||||||
|
ocv_target_link_libraries(${the_module} LINK_PUBLIC log dl z) |
||||||
|
|
||||||
|
# force strip library after the build command |
||||||
|
# because samples and tests will make a copy of the library before install |
||||||
|
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") |
||||||
|
add_custom_command(TARGET ${the_module} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "$<TARGET_FILE:${the_module}>") |
||||||
|
endif() |
||||||
|
endif() |
||||||
|
|
||||||
|
if(ENABLE_SOLUTION_FOLDERS) |
||||||
|
set_target_properties(${the_module} PROPERTIES FOLDER "bindings") |
||||||
|
endif() |
||||||
|
|
||||||
|
set(__install_export "") |
||||||
|
if(BUILD_FAT_JAVA_LIB) |
||||||
|
set(__install_export EXPORT OpenCVModules) |
||||||
|
endif() |
||||||
|
|
||||||
|
ocv_install_target(${the_module} OPTIONAL ${__install_export} |
||||||
|
RUNTIME DESTINATION ${OPENCV_JNI_BIN_INSTALL_PATH} COMPONENT java |
||||||
|
LIBRARY DESTINATION ${OPENCV_JNI_INSTALL_PATH} COMPONENT java |
||||||
|
ARCHIVE DESTINATION ${OPENCV_JNI_INSTALL_PATH} COMPONENT java |
||||||
|
) |
@ -1,72 +1,74 @@ |
|||||||
if(NOT ANT_EXECUTABLE |
if(NOT ANT_EXECUTABLE |
||||||
OR NOT BUILD_opencv_imgcodecs |
OR NOT BUILD_opencv_imgcodecs |
||||||
OR NOT BUILD_opencv_calib3d) |
OR NOT BUILD_opencv_calib3d) |
||||||
return() |
return() |
||||||
endif() |
endif() |
||||||
|
|
||||||
project(opencv_test_java) |
project(opencv_test_java) |
||||||
|
|
||||||
set(opencv_test_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build") |
set(OPENCV_JAR_FILE "${OPENCV_JAR_FILE}") |
||||||
set(test_dir ${CMAKE_CURRENT_SOURCE_DIR}) |
get_filename_component(JAR_NAME "${OPENCV_JAR_FILE}" NAME) |
||||||
set(test_common_dir "${CMAKE_CURRENT_SOURCE_DIR}/../common_test") |
|
||||||
|
set(OPENCV_JAVA_TEST_DIR "${OpenCV_BINARY_DIR}/java_test" CACHE INTERNAL "") |
||||||
|
file(REMOVE_RECURSE "${OPENCV_JAVA_TEST_DIR}") |
||||||
|
file(MAKE_DIRECTORY "${OPENCV_JAVA_TEST_DIR}") |
||||||
|
file(REMOVE "${OPENCV_DEPHELPER}/${the_module}_test_source_copy") |
||||||
|
|
||||||
set(opencv_test_java_file_deps "") |
set(test_dir ${CMAKE_CURRENT_SOURCE_DIR}) |
||||||
|
|
||||||
# make sure the build directory exists |
set(depends "") |
||||||
file(MAKE_DIRECTORY "${opencv_test_java_bin_dir}") |
|
||||||
|
|
||||||
# 1. gather and copy common test files (resources, utils, etc.) |
# 1. gather and copy common test files (resources, utils, etc.) |
||||||
copy_common_tests(test_common_dir opencv_test_java_bin_dir opencv_test_java_file_deps) |
copy_common_tests("${CMAKE_CURRENT_SOURCE_DIR}/../common_test" "${OPENCV_JAVA_TEST_DIR}" depends) |
||||||
|
|
||||||
# 2. gather and copy tests from each module |
# 2. gather and copy tests from each module |
||||||
copy_modules_tests(OPENCV_JAVA_MODULES opencv_test_java_bin_dir opencv_test_java_file_deps) |
ocv_copyfiles_append_dir(JAVA_TEST_SRC_COPY "${OPENCV_JAVA_BINDINGS_DIR}/gen/test" "${OPENCV_JAVA_TEST_DIR}/src") |
||||||
|
|
||||||
|
list(APPEND depends gen_opencv_java_source "${OPENCV_DEPHELPER}/gen_opencv_java_source") |
||||||
|
ocv_copyfiles_add_target(${the_module}_test_source_copy JAVA_TEST_SRC_COPY "Copy Java(Test) source files" ${depends}) |
||||||
|
set(depends ${the_module}_test_source_copy "${OPENCV_DEPHELPER}/${the_module}_test_source_copy") |
||||||
|
|
||||||
# 3. gather and copy specific files for pure java |
# 3. gather and copy specific files for pure java |
||||||
file(GLOB_RECURSE test_files RELATIVE "${test_dir}" "${test_dir}/src/*") |
file(GLOB_RECURSE test_files RELATIVE "${test_dir}" "${test_dir}/src/*") |
||||||
file(GLOB_RECURSE test_lib_files RELATIVE "${test_dir}" "${test_dir}/lib/*.jar") |
file(GLOB_RECURSE test_lib_files RELATIVE "${test_dir}" "${test_dir}/lib/*.jar") |
||||||
foreach(f ${test_files} ${test_lib_files}) |
foreach(f ${test_files} ${test_lib_files}) |
||||||
add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/${f}" |
add_custom_command(OUTPUT "${OPENCV_JAVA_TEST_DIR}/${f}" |
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${test_dir}/${f}" "${opencv_test_java_bin_dir}/${f}" |
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${test_dir}/${f}" "${OPENCV_JAVA_TEST_DIR}/${f}" |
||||||
DEPENDS "${test_dir}/${f}" |
DEPENDS "${test_dir}/${f}" |
||||||
COMMENT "Copying ${f}" |
COMMENT "Copying ${f}" |
||||||
) |
) |
||||||
list(APPEND opencv_test_java_file_deps "${test_dir}/${f}" "${opencv_test_java_bin_dir}/${f}") |
list(APPEND depends "${test_dir}/${f}" "${OPENCV_JAVA_TEST_DIR}/${f}") |
||||||
endforeach() |
endforeach() |
||||||
|
|
||||||
# Copy the OpenCV jar after it has been generated. |
# Copy the OpenCV jar after it has been generated. |
||||||
add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/bin/${JAR_NAME}" |
add_custom_command(OUTPUT "${OPENCV_JAVA_TEST_DIR}/bin/${JAR_NAME}" |
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${JAR_FILE}" "${opencv_test_java_bin_dir}/bin/${JAR_NAME}" |
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENCV_JAR_FILE}" "${OPENCV_JAVA_TEST_DIR}/bin/${JAR_NAME}" |
||||||
DEPENDS "${JAR_FILE}" |
DEPENDS "${OPENCV_JAR_FILE}" "${OPENCV_DEPHELPER}/${the_module}_jar" |
||||||
COMMENT "Copying the OpenCV jar" |
COMMENT "Copying the OpenCV jar" |
||||||
) |
) |
||||||
|
|
||||||
add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/build.xml" |
add_custom_command(OUTPUT "${OPENCV_JAVA_TEST_DIR}/build.xml" |
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/build.xml" "${opencv_test_java_bin_dir}/build.xml" |
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/build.xml" "${OPENCV_JAVA_TEST_DIR}/build.xml" |
||||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/build.xml" |
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/build.xml" |
||||||
COMMENT "Copying build.xml" |
COMMENT "Copying build.xml" |
||||||
) |
) |
||||||
|
|
||||||
add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/build/jar/opencv-test.jar" |
add_custom_command(OUTPUT "${OPENCV_JAVA_TEST_DIR}/build/jar/opencv-test.jar" |
||||||
COMMAND "${ANT_EXECUTABLE}" build |
COMMAND "${ANT_EXECUTABLE}" -noinput -k build |
||||||
WORKING_DIRECTORY "${opencv_test_java_bin_dir}" |
WORKING_DIRECTORY "${OPENCV_JAVA_TEST_DIR}" |
||||||
DEPENDS ${opencv_test_java_file_deps} "${opencv_test_java_bin_dir}/build.xml" "${CMAKE_CURRENT_SOURCE_DIR}/build.xml" "${JAR_FILE}" "${opencv_test_java_bin_dir}/bin/${JAR_NAME}" |
DEPENDS ${depends} "${OPENCV_JAVA_TEST_DIR}/build.xml" "${CMAKE_CURRENT_SOURCE_DIR}/build.xml" "${OPENCV_JAR_FILE}" "${OPENCV_JAVA_TEST_DIR}/bin/${JAR_NAME}" |
||||||
COMMENT "Build Java tests" |
COMMENT "Build Java tests" |
||||||
) |
) |
||||||
|
|
||||||
# Not add_custom_command because generator expressions aren't supported in |
file(GENERATE OUTPUT "${OPENCV_JAVA_TEST_DIR}/ant-$<CONFIGURATION>.properties" CONTENT "opencv.lib.path=$<TARGET_FILE_DIR:${the_module}>") |
||||||
# OUTPUT file names, and we need to generate different files for different |
|
||||||
# configurations. |
|
||||||
add_custom_target(${PROJECT_NAME}_properties |
|
||||||
COMMAND "${CMAKE_COMMAND}" -E echo "opencv.lib.path = $<TARGET_FILE_DIR:${the_module}>" |
|
||||||
> "${opencv_test_java_bin_dir}/ant-$<CONFIGURATION>.properties" |
|
||||||
VERBATIM |
|
||||||
) |
|
||||||
|
|
||||||
add_custom_target(${PROJECT_NAME} ALL |
add_custom_target(${PROJECT_NAME} ALL |
||||||
DEPENDS ${the_module} ${PROJECT_NAME}_properties |
DEPENDS ${the_module} "${OPENCV_JAVA_TEST_DIR}/build/jar/opencv-test.jar" |
||||||
SOURCES "${opencv_test_java_bin_dir}/build/jar/opencv-test.jar" |
SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/build.xml" |
||||||
) |
) |
||||||
|
|
||||||
if(ENABLE_SOLUTION_FOLDERS) |
if(ENABLE_SOLUTION_FOLDERS) |
||||||
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "tests accuracy") |
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "tests accuracy") |
||||||
endif() |
endif() |
||||||
|
|
||||||
|
add_dependencies(opencv_tests ${PROJECT_NAME}) |
||||||
|
@ -1,6 +1,6 @@ |
|||||||
set(sample example-15-puzzle) |
set(sample example-15-puzzle) |
||||||
|
|
||||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS "${OPENCV_ANDROID_LIB_DIR}" SDK_TARGET 11 "${ANDROID_SDK_TARGET}") |
||||||
if(TARGET ${sample}) |
if(TARGET ${sample}) |
||||||
add_dependencies(opencv_android_examples ${sample}) |
add_dependencies(opencv_android_examples ${sample}) |
||||||
endif() |
endif() |
||||||
|
@ -1,6 +1,6 @@ |
|||||||
set(sample example-camera-calibration) |
set(sample example-camera-calibration) |
||||||
|
|
||||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS "${OPENCV_ANDROID_LIB_DIR}" SDK_TARGET 11 "${ANDROID_SDK_TARGET}") |
||||||
if(TARGET ${sample}) |
if(TARGET ${sample}) |
||||||
add_dependencies(opencv_android_examples ${sample}) |
add_dependencies(opencv_android_examples ${sample}) |
||||||
endif() |
endif() |
||||||
|
@ -1,6 +1,6 @@ |
|||||||
set(sample example-color-blob-detection) |
set(sample example-color-blob-detection) |
||||||
|
|
||||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS "${OPENCV_ANDROID_LIB_DIR}" SDK_TARGET 11 "${ANDROID_SDK_TARGET}") |
||||||
if(TARGET ${sample}) |
if(TARGET ${sample}) |
||||||
add_dependencies(opencv_android_examples ${sample}) |
add_dependencies(opencv_android_examples ${sample}) |
||||||
endif() |
endif() |
||||||
|
@ -1,6 +1,6 @@ |
|||||||
set(sample example-image-manipulations) |
set(sample example-image-manipulations) |
||||||
|
|
||||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS "${OPENCV_ANDROID_LIB_DIR}" SDK_TARGET 11 "${ANDROID_SDK_TARGET}") |
||||||
if(TARGET ${sample}) |
if(TARGET ${sample}) |
||||||
add_dependencies(opencv_android_examples ${sample}) |
add_dependencies(opencv_android_examples ${sample}) |
||||||
endif() |
endif() |
||||||
|
@ -1,6 +1,6 @@ |
|||||||
set(sample example-mobilenet-objdetect) |
set(sample example-mobilenet-objdetect) |
||||||
|
|
||||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS "${OPENCV_ANDROID_LIB_DIR}" SDK_TARGET 11 "${ANDROID_SDK_TARGET}") |
||||||
if(TARGET ${sample}) |
if(TARGET ${sample}) |
||||||
add_dependencies(opencv_android_examples ${sample}) |
add_dependencies(opencv_android_examples ${sample}) |
||||||
endif() |
endif() |
||||||
|
@ -1,6 +1,6 @@ |
|||||||
set(sample example-tutorial-1-camerapreview) |
set(sample example-tutorial-1-camerapreview) |
||||||
|
|
||||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS "${OPENCV_ANDROID_LIB_DIR}" SDK_TARGET 11 "${ANDROID_SDK_TARGET}") |
||||||
if(TARGET ${sample}) |
if(TARGET ${sample}) |
||||||
add_dependencies(opencv_android_examples ${sample}) |
add_dependencies(opencv_android_examples ${sample}) |
||||||
endif() |
endif() |
||||||
|
@ -1,6 +1,6 @@ |
|||||||
set(sample example-tutorial-3-cameracontrol) |
set(sample example-tutorial-3-cameracontrol) |
||||||
|
|
||||||
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS ${OpenCV_BINARY_DIR} SDK_TARGET 11 ${ANDROID_SDK_TARGET}) |
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS "${OPENCV_ANDROID_LIB_DIR}" SDK_TARGET 11 "${ANDROID_SDK_TARGET}") |
||||||
if(TARGET ${sample}) |
if(TARGET ${sample}) |
||||||
add_dependencies(opencv_android_examples ${sample}) |
add_dependencies(opencv_android_examples ${sample}) |
||||||
endif() |
endif() |
||||||
|
Loading…
Reference in new issue