1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2018-09-28 12:48:51 +03:00
77 changed files with 586 additions and 443 deletions
+27 -13
View File
@@ -1,24 +1,42 @@
# ----------------------------------------------------------------------------
# CMake file for js support
# ----------------------------------------------------------------------------
# message(STATUS "---------------- Start of JavaScript module ----------------------")
set(the_description "The js bindings")
set(MODULE_NAME js)
if(NOT BUILD_opencv_js) # should be enabled explicitly (by build_js.py script)
ocv_module_disable(js)
endif()
set(OPENCV_JS "opencv.js")
ocv_add_module(${MODULE_NAME} BINDINGS)
find_path(EMSCRIPTEN_INCLUDE_DIR
emscripten/bind.h
PATHS
ENV EMSCRIPTEN_ROOT
PATH_SUFFIXES system/include include
DOC "Location of Emscripten SDK")
# TODO: add emscripten path
ocv_module_include_directories()
if(NOT EMSCRIPTEN_INCLUDE_DIR OR NOT PYTHON_DEFAULT_AVAILABLE)
set(DISABLE_MSG "Module 'js' disabled because the following dependencies are not found:")
if(NOT EMSCRIPTEN_INCLUDE_DIR)
set(DISABLE_MSG "${DISABLE_MSG} Emscripten")
endif()
if(NOT PYTHON_DEFAULT_AVAILABLE)
set(DISABLE_MSG "${DISABLE_MSG} Python")
endif()
message(STATUS ${DISABLE_MSG})
ocv_module_disable(js)
endif()
ocv_add_module(js BINDINGS)
ocv_module_include_directories(${EMSCRIPTEN_INCLUDE_DIR})
# get list of modules to wrap
# message(STATUS "Wrapped in ${MODULE_NAME}:")
# message(STATUS "Wrapped in js:")
set(OPENCV_JS_MODULES)
foreach(m ${OPENCV_MODULES_BUILD})
if (";${OPENCV_MODULE_${m}_WRAPPERS};" MATCHES ";${MODULE_NAME};" AND HAVE_${m})
if(";${OPENCV_MODULE_${m}_WRAPPERS};" MATCHES ";js;" AND HAVE_${m})
list(APPEND OPENCV_JS_MODULES ${m})
# message(STATUS "\t${m}")
endif()
@@ -125,7 +143,3 @@ list(APPEND opencv_test_js_file_deps "${test_data_path}" "${opencv_test_js_bin_d
add_custom_target(${PROJECT_NAME}_test ALL
DEPENDS ${OCV_JS_PATH} ${opencv_test_js_file_deps})
unset(MODULE_NAME)
# message(STATUS "---------------- End of JavaScript module ----------------------")
+3
View File
@@ -103,4 +103,7 @@ if __name__ == "__main__":
if len(sys.argv) > 2:
opencvjs = sys.argv[1]
cvjs = sys.argv[2]
if not os.path.isfile(opencvjs):
print('opencv.js file not found! Have you compiled the opencv_js module?')
exit()
make_umd(opencvjs, cvjs);