# ----------------------------------------------------------------------------
# CMake file for java support
# ----------------------------------------------------------------------------
if ( IOS OR NOT PYTHON_DEFAULT_AVAILABLE OR NOT ANT_EXECUTABLE OR NOT ( JNI_FOUND OR ( ANDROID AND ANDROID_NATIVE_API_LEVEL GREATER 7 ) )
O R B U I L D _ o p e n c v _ w o r l d
)
ocv_module_disable ( java )
endif ( )
set ( the_description "The java bindings" )
ocv_add_module ( java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_imgcodecs opencv_videoio opencv_calib3d opencv_photo opencv_nonfree opencv_contrib )
ocv_module_include_directories ( "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp" )
if ( NOT ANDROID )
include_directories ( ${ JNI_INCLUDE_DIRS } )
endif ( )
# output locations
set ( JAVA_INSTALL_ROOT "sdk/java" )
set ( JNI_INSTALL_ROOT "sdk/native" )
# get list of modules to wrap
string ( REPLACE "opencv_" "" OPENCV_JAVA_MODULES "${OPENCV_MODULE_${the_module}_REQ_DEPS};${OPENCV_MODULE_${the_module}_OPT_DEPS}" )
foreach ( module ${ OPENCV_JAVA_MODULES } )
if ( NOT HAVE_opencv_ ${ module } )
list ( REMOVE_ITEM OPENCV_JAVA_MODULES ${ module } )
endif ( )
endforeach ( )
######################################################################################################################################
# scripts
set ( scripts_gen_java "${CMAKE_CURRENT_SOURCE_DIR}/generator/gen_java.py" )
set ( scripts_hdr_parser "${CMAKE_CURRENT_SOURCE_DIR}/../python/src2/hdr_parser.py" )
set ( scripts_gen_javadoc "${CMAKE_CURRENT_SOURCE_DIR}/generator/gen_javadoc.py" )
set ( scripts_rst_parser "${CMAKE_CURRENT_SOURCE_DIR}/generator/rst_parser.py" )
# handwritten C/C++ and Java sources
file ( GLOB handwrittren_h_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp/*.hpp" )
file ( GLOB handwrittren_cpp_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp/*.cpp" )
file ( GLOB handwrittren_java_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/java/*.java" )
file ( GLOB handwrittren_aidl_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/java/*.aidl" )
if ( NOT ANDROID )
ocv_list_filterout ( handwrittren_java_sources "/(engine|android)\\\\+" )
ocv_list_filterout ( handwrittren_aidl_sources "/(engine|android)\\\\+" )
else ( )
file ( GLOB_RECURSE handwrittren_lib_project_files_rel RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/" "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/*" )
list ( REMOVE_ITEM handwrittren_lib_project_files_rel "${ANDROID_MANIFEST_FILE}" )
endif ( )
# headers of OpenCV modules
set ( opencv_public_headers "" )
foreach ( module ${ OPENCV_JAVA_MODULES } )
# get list of module headers
if ( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/generator/config/${module}.filelist" )
file ( STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/generator/config/${module}.filelist" module_headers )
ocv_list_add_prefix ( module_headers "${OPENCV_MODULE_opencv_${module}_LOCATION}/" )
else ( )
set ( module_headers "${OPENCV_MODULE_opencv_${module}_HEADERS}" )
endif ( )
if ( module_headers )
# C headers must go first
set ( module_headers_cpp ${ module_headers } )
ocv_list_filterout ( module_headers_cpp "\\\\.h$" )
if ( module_headers_cpp )
list ( REMOVE_ITEM module_headers ${ module_headers_cpp } )
list ( APPEND module_headers ${ module_headers_cpp } )
endif ( )
unset ( module_headers_cpp )
set ( opencv_public_headers_ ${ module } ${ module_headers } )
list ( APPEND opencv_public_headers ${ module_headers } )
else ( )
list ( REMOVE_ITEM OPENCV_JAVA_MODULES ${ module } )
endif ( )
endforeach ( )
# rst documentation used for javadoc generation
set ( javadoc_rst_sources "" )
foreach ( module ${ OPENCV_JAVA_MODULES } )
file ( GLOB_RECURSE refman_rst_headers "${OPENCV_MODULE_opencv_${module}_LOCATION}/*.rst" )
list ( APPEND javadoc_rst_sources ${ refman_rst_headers } )
endforeach ( )
# generated cpp files
set ( generated_cpp_sources "" )
foreach ( module ${ OPENCV_JAVA_MODULES } )
list ( APPEND generated_cpp_sources "${CMAKE_CURRENT_BINARY_DIR}/${module}.cpp" )
endforeach ( )
# IMPORTANT: add dependencies to cmake (we should rerun cmake if any of these files is modified)
configure_file ( "${scripts_gen_java}" "${OpenCV_BINARY_DIR}/junk/gen_java.junk" COPYONLY )
configure_file ( "${scripts_hdr_parser}" "${OpenCV_BINARY_DIR}/junk/hdr_parser.junk" COPYONLY )
foreach ( header ${ opencv_public_headers } )
get_filename_component ( header_name "${header}" NAME )
configure_file ( "${header}" "${OpenCV_BINARY_DIR}/junk/${header_name}.junk" COPYONLY )
endforeach ( )
# generated java files
set ( generated_java_sources "" )
foreach ( module ${ OPENCV_JAVA_MODULES } )
# first run of gen_java.py (to get list of generated files)
file ( REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out/" )
file ( MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out" )
execute_process ( COMMAND ${ PYTHON_DEFAULT_EXECUTABLE } "${scripts_gen_java}" "${scripts_hdr_parser}" ${ module } ${ opencv_public_headers_${module } }
W O R K I N G _ D I R E C T O R Y " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / g e n _ j a v a _ o u t "
O U T P U T _ Q U I E T E R R O R _ Q U I E T )
unset ( generated_java_sources_ ${ module } )
file ( GLOB_RECURSE generated_java_sources_ ${ module } RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out/" "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out/*.java" )
ocv_list_add_prefix ( generated_java_sources_ ${ module } "${CMAKE_CURRENT_BINARY_DIR}/" )
list ( APPEND generated_java_sources ${ generated_java_sources_${module } } )
endforeach ( )
# generated java files with javadoc
set ( documented_java_files "" )
foreach ( java_file ${ generated_java_sources } ${ handwrittren_java_sources } )
get_filename_component ( java_file_name "${java_file}" NAME_WE )
list ( APPEND documented_java_files "${CMAKE_CURRENT_BINARY_DIR}/${java_file_name}-jdoc.java" )
endforeach ( )
######################################################################################################################################
# step 1: generate .cpp/.java from OpenCV headers
set ( step1_depends "${scripts_gen_java}" "${scripts_hdr_parser}" ${ opencv_public_headers } )
foreach ( module ${ OPENCV_JAVA_MODULES } )
# second run of gen_java.py (at build time)
add_custom_command ( OUTPUT ${ generated_java_sources_${module } } "${CMAKE_CURRENT_BINARY_DIR}/${module}.cpp"
C O M M A N D $ { P Y T H O N _ D E F A U L T _ E X E C U T A B L E } " $ { s c r i p t s _ g e n _ j a v a } " " $ { s c r i p t s _ h d r _ p a r s e r } " $ { m o d u l e } $ { o p e n c v _ p u b l i c _ h e a d e r s _ $ { m o d u l e } }
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R }
D E P E N D S " $ { s c r i p t s _ g e n _ j a v a } " " $ { s c r i p t s _ h d r _ p a r s e r } " $ { o p e n c v _ p u b l i c _ h e a d e r s _ $ { m o d u l e } }
)
endforeach ( )
# step 2: generate javadoc comments
set ( step2_depends ${ step1_depends } ${ scripts_gen_javadoc } ${ scripts_rst_parser } ${ javadoc_rst_sources } ${ generated_java_sources } ${ handwrittren_java_sources } )
string ( REPLACE ";" "," OPENCV_JAVA_MODULES_STR "${OPENCV_JAVA_MODULES}" )
add_custom_command ( OUTPUT ${ documented_java_files }
C O M M A N D $ { P Y T H O N _ D E F U A L T _ E X E C U T A B L E } " $ { s c r i p t s _ g e n _ j a v a d o c } " - - m o d u l e s $ { O P E N C V _ J A V A _ M O D U L E S _ S T R } " $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / g e n e r a t o r / s r c / j a v a " " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } " 2 > " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / g e t _ j a v a d o c _ e r r o r s . l o g "
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R }
D E P E N D S $ { s t e p 2 _ d e p e n d s }
V E R B A T I M
)
# step 3: copy files to destination
set ( step3_input_files ${ documented_java_files } ${ handwrittren_aidl_sources } )
set ( copied_files "" )
foreach ( java_file ${ step3_input_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}" )
set ( output_name "${OpenCV_BINARY_DIR}/src/org/opencv/${java_file_name}" )
add_custom_command ( OUTPUT "${output_name}"
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y " $ { j a v a _ f i l e } " " $ { o u t p u t _ n a m e } "
M A I N _ D E P E N D E N C Y " $ { j a v a _ f i l e } "
D E P E N D S $ { s t e p 2 _ d e p e n d s }
C O M M E N T " G e n e r a t i n g s r c / o r g / o p e n c v / $ { j a v a _ f i l e _ n a m e } "
)
list ( APPEND copied_files "${output_name}" )
if ( ANDROID )
get_filename_component ( install_subdir "${java_file_name}" PATH )
install ( FILES "${output_name}" DESTINATION "${JAVA_INSTALL_ROOT}/src/org/opencv/${install_subdir}" COMPONENT java )
endif ( )
endforeach ( )
if ( ANDROID )
set ( android_copied_files "" )
set ( android_step3_input_files "" )
foreach ( file ${ handwrittren_lib_project_files_rel } )
configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/${file}" "${OpenCV_BINARY_DIR}/${file}" @ONLY )
list ( APPEND android_copied_files "${OpenCV_BINARY_DIR}/${file}" )
list ( APPEND android_step3_input_files "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/${file}" )
if ( NOT file MATCHES "jni/.+" )
get_filename_component ( install_subdir "${file}" PATH )
install ( FILES "${OpenCV_BINARY_DIR}/${file}" DESTINATION "${JAVA_INSTALL_ROOT}/${install_subdir}" COMPONENT java )
endif ( )
endforeach ( )
# library project jni sources (nothing really depends on them so we will not add them to step3_input_files)
foreach ( jni_file ${ handwrittren_cpp_sources } ${ handwrittren_h_sources } ${ generated_cpp_sources } )
get_filename_component ( jni_file_name "${jni_file}" NAME )
add_custom_command ( OUTPUT "${OpenCV_BINARY_DIR}/jni/${jni_file_name}"
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y " $ { j n i _ f i l e } " " $ { O p e n C V _ B I N A R Y _ D I R } / j n i / $ { j n i _ f i l e _ n a m e } "
D E P E N D S " $ { j n i _ f i l e } " $ { j a v a _ h d r _ d e p s }
C O M M E N T " G e n e r a t i n g j n i / $ { j n i _ f i l e _ n a m e } "
)
list ( APPEND android_copied_files "${OpenCV_BINARY_DIR}/jni/${jni_file_name}" )
endforeach ( )
endif ( ANDROID )
# step 3.5: generate Android library project
if ( ANDROID AND ANDROID_EXECUTABLE )
set ( lib_target_files ${ ANDROID_LIB_PROJECT_FILES } )
ocv_list_add_prefix ( lib_target_files "${OpenCV_BINARY_DIR}/" )
android_get_compatible_target ( lib_target_sdk_target ${ ANDROID_NATIVE_API_LEVEL } ${ ANDROID_SDK_TARGET } 14 )
configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/${ANDROID_MANIFEST_FILE}" "${CMAKE_CURRENT_BINARY_DIR}/${ANDROID_MANIFEST_FILE}" @ONLY )
add_custom_command ( OUTPUT ${ lib_target_files } "${OpenCV_BINARY_DIR}/${ANDROID_MANIFEST_FILE}"
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e $ { l i b _ t a r g e t _ f i l e s }
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { A N D R O I D _ M A N I F E S T _ F I L E } " " $ { O p e n C V _ B I N A R Y _ D I R } / $ { A N D R O I D _ M A N I F E S T _ F I L E } "
C O M M A N D $ { A N D R O I D _ E X E C U T A B L E } - - s i l e n t c r e a t e l i b - p r o j e c t - - p a t h \ " $ { O p e n C V _ B I N A R Y _ D I R } \ " - - t a r g e t \ " $ { l i b _ t a r g e t _ s d k _ t a r g e t } \ " - - n a m e O p e n C V - - p a c k a g e o r g . o p e n c v 2 > \ " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c r e a t e _ l i b _ p r o j e c t . l o g \ "
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { A N D R O I D _ M A N I F E S T _ F I L E } " " $ { O p e n C V _ B I N A R Y _ D I R } / $ { A N D R O I D _ M A N I F E S T _ F I L E } "
M A I N _ D E P E N D E N C Y " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { A N D R O I D _ M A N I F E S T _ F I L E } "
D E P E N D S $ { a n d r o i d _ s t e p 3 _ i n p u t _ f i l e s } $ { a n d r o i d _ c o p i e d _ f i l e s }
C O M M E N T " G e n e r a t i n g O p e n C V A n d r o i d l i b r a r y p r o j e c t . S D K t a r g e t : $ { l i b _ t a r g e t _ s d k _ t a r g e t } "
)
list ( APPEND copied_files ${ lib_target_files } "${OpenCV_BINARY_DIR}/${ANDROID_MANIFEST_FILE}" )
list ( APPEND step3_input_files "${CMAKE_CURRENT_BINARY_DIR}/${ANDROID_MANIFEST_FILE}" )
install ( FILES "${OpenCV_BINARY_DIR}/${ANDROID_PROJECT_PROPERTIES_FILE}" DESTINATION ${ JAVA_INSTALL_ROOT } COMPONENT java )
install ( FILES "${OpenCV_BINARY_DIR}/${ANDROID_MANIFEST_FILE}" DESTINATION ${ JAVA_INSTALL_ROOT } COMPONENT java )
# creating empty 'gen' and 'res' folders
install ( CODE "MAKE_DIRECTORY(\" \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${JAVA_INSTALL_ROOT}/gen\")" COMPONENT java )
install ( CODE "MAKE_DIRECTORY(\" \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${JAVA_INSTALL_ROOT}/res\")" COMPONENT java )
endif ( ANDROID AND ANDROID_EXECUTABLE )
set ( step3_depends ${ step2_depends } ${ step3_input_files } ${ copied_files } )
if ( ANDROID )
set ( LIB_NAME_SUFIX "" )
else ( )
set ( LIB_NAME_SUFIX "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}" )
endif ( )
# step 4: build jar
if ( ANDROID )
set ( JAR_FILE "${OpenCV_BINARY_DIR}/bin/classes.jar" )
if ( ANDROID_TOOLS_Pkg_Revision GREATER 13 )
# 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}" "${JAR_FILE}.dephelper"
C O M M A N D $ { A N T _ E X E C U T A B L E } - q - n o i n p u t - k d e b u g
C O M M A N D $ { C M A K E _ C O M M A N D } - E t o u c h " $ { J A R _ F I L E } . d e p h e l p e r " # can not rely on classes.jar because different versions of SDK update timestamp at different times
W O R K I N G _ D I R E C T O R Y " $ { O p e n C V _ B I N A R Y _ D I R } "
D E P E N D S $ { s t e p 3 _ d e p e n d s }
C O M M E N T " B u i l d i n g O p e n C V A n d r o i d l i b r a r y p r o j e c t "
)
else ( )
# ditto
add_custom_command ( OUTPUT "${JAR_FILE}" "${JAR_FILE}.dephelper"
C O M M A N D $ { C M A K E _ C O M M A N D } - E t o u c h " $ { J A R _ F I L E } "
C O M M A N D $ { C M A K E _ C O M M A N D } - E t o u c h " $ { J A R _ F I L E } . d e p h e l p e r "
W O R K I N G _ D I R E C T O R Y " $ { O p e n C V _ B I N A R Y _ D I R } "
D E P E N D S $ { s t e p 3 _ d e p e n d s }
C O M M E N T " "
)
endif ( )
else ( ANDROID )
set ( JAR_NAME opencv- ${ LIB_NAME_SUFIX } .jar )
set ( JAR_FILE "${OpenCV_BINARY_DIR}/bin/${JAR_NAME}" )
configure_file ( "${CMAKE_CURRENT_SOURCE_DIR}/build.xml.in" "${OpenCV_BINARY_DIR}/build.xml" @ONLY )
list ( APPEND step3_depends "${OpenCV_BINARY_DIR}/build.xml" )
add_custom_command ( OUTPUT "${JAR_FILE}" "${JAR_FILE}.dephelper"
C O M M A N D $ { A N T _ E X E C U T A B L E } - q - n o i n p u t - k j a r
C O M M A N D $ { C M A K E _ C O M M A N D } - E t o u c h " $ { J A R _ F I L E } . d e p h e l p e r "
W O R K I N G _ D I R E C T O R Y " $ { O p e n C V _ B I N A R Y _ D I R } "
D E P E N D S $ { s t e p 3 _ d e p e n d s }
C O M M E N T " G e n e r a t i n g $ { J A R _ N A M E } "
)
if ( WIN32 )
set ( JAR_INSTALL_DIR java )
else ( WIN32 )
set ( JAR_INSTALL_DIR share/OpenCV/java )
endif ( WIN32 )
install ( FILES ${ JAR_FILE } DESTINATION ${ JAR_INSTALL_DIR } COMPONENT java )
endif ( ANDROID )
# step 5: build native part
# workarounding lack of `__attribute__ ((visibility("default")))` in jni_md.h/JNIEXPORT
string ( REPLACE "-fvisibility=hidden" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
ocv_add_library ( ${ the_module } SHARED ${ handwrittren_h_sources } ${ handwrittren_cpp_sources } ${ generated_cpp_sources }
$ { c o p i e d _ f i l e s }
" $ { J A R _ F I L E } " " $ { J A R _ F I L E } . d e p h e l p e r " )
set_target_properties ( ${ the_module } PROPERTIES COMPILE_DEFINITIONS OPENCV_NOSTL )
if ( BUILD_FAT_JAVA_LIB )
set ( __deps ${ OPENCV_MODULE_${the_module } _DEPS} ${ OPENCV_MODULES_BUILD } )
foreach ( m ${ OPENCV_MODULES_BUILD } ) # filterout INTERNAL (like opencv_ts) and BINDINGS (like opencv_python) modules
ocv_assert ( DEFINED OPENCV_MODULE_ ${ m } _CLASS )
if ( NOT OPENCV_MODULE_ ${ m } _CLASS STREQUAL "PUBLIC" )
list ( REMOVE_ITEM __deps ${ m } )
endif ( )
endforeach ( )
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 } -Wl,-force_load "${_dep}" )
endforeach ( )
else ( )
ocv_target_link_libraries ( ${ the_module } -Wl,-whole-archive ${ __deps } -Wl,-no-whole-archive )
endif ( )
ocv_target_link_libraries ( ${ the_module } ${ __extradeps } ${ OPENCV_LINKER_LIBS } )
else ( )
ocv_target_link_libraries ( ${ the_module } ${ OPENCV_MODULE_${the_module } _DEPS} ${ OPENCV_LINKER_LIBS } )
endif ( )
if ( ANDROID )
ocv_target_link_libraries ( ${ the_module } jnigraphics ) # for Mat <=> Bitmap converters
# force strip library after the build command
# because samples and tests will make a copy of the library before install
get_target_property ( __opencv_java_location ${ the_module } LOCATION )
# Turn off stripping in debug build
if ( NOT ( CMAKE_BUILD_TYPE MATCHES "Debug" ) )
add_custom_command ( TARGET ${ the_module } POST_BUILD COMMAND ${ CMAKE_STRIP } --strip-unneeded "${__opencv_java_location}" )
endif ( )
endif ( )
# Additional target properties
set_target_properties ( ${ the_module } PROPERTIES
O U T P U T _ N A M E " $ { t h e _ m o d u l e } $ { L I B _ N A M E _ S U F I X } "
A R C H I V E _ O U T P U T _ D I R E C T O R Y $ { L I B R A R Y _ O U T P U T _ P A T H }
L I B R A R Y _ O U T P U T _ D I R E C T O R Y $ { L I B R A R Y _ O U T P U T _ P A T H }
R U N T I M E _ O U T P U T _ D I R E C T O R Y $ { E X E C U T A B L E _ O U T P U T _ P A T H }
I N S T A L L _ N A M E _ D I R $ { O P E N C V _ L I B _ I N S T A L L _ P A T H }
L I N K _ I N T E R F A C E _ L I B R A R I E S " "
)
if ( WIN32 )
set_target_properties ( ${ the_module } PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${ EXECUTABLE_OUTPUT_PATH } )
endif ( )
if ( ENABLE_SOLUTION_FOLDERS )
set_target_properties ( ${ the_module } PROPERTIES FOLDER "bindings" )
endif ( )
if ( ANDROID )
ocv_install_target ( ${ the_module } EXPORT OpenCVModules
L I B R A R Y D E S T I N A T I O N $ { O P E N C V _ L I B _ I N S T A L L _ P A T H } C O M P O N E N T j a v a
A R C H I V E D E S T I N A T I O N $ { O P E N C V _ L I B _ I N S T A L L _ P A T H } C O M P O N E N T j a v a )
else ( )
if ( NOT INSTALL_CREATE_DISTRIB )
ocv_install_target ( ${ the_module } EXPORT OpenCVModules
R U N T I M E D E S T I N A T I O N $ { J A R _ I N S T A L L _ D I R } C O M P O N E N T j a v a
L I B R A R Y D E S T I N A T I O N $ { J A R _ I N S T A L L _ D I R } C O M P O N E N T j a v a )
else ( )
ocv_install_target ( ${ the_module } EXPORT OpenCVModules
R U N T I M E D E S T I N A T I O N $ { J A R _ I N S T A L L _ D I R } / $ { O p e n C V _ A R C H } C O M P O N E N T j a v a
L I B R A R Y D E S T I N A T I O N $ { J A R _ I N S T A L L _ D I R } / $ { O p e n C V _ A R C H } C O M P O N E N T j a v a )
endif ( )
endif ( )
######################################################################################################################################
if ( BUILD_TESTS )
if ( ANDROID )
add_subdirectory ( android_test )
else ( )
add_subdirectory ( test )
endif ( )
endif ( )