cordova: Add UPM cordova binding via Java packages

The UPM Cordova binding generator creates Cordova plugs for each Java
package when BUILDCORDOVA=ON and BUILDSWIGJAVA=ON.  This requires an NPM
install of the UPM Cordova plugin generator.  Cordova bindings are built
under <build-dir>/cordova.

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Lin Sun
2017-11-22 22:14:59 +08:00
committed by Noel Eck
parent 54c6d294af
commit f45429e1f0
3 changed files with 38 additions and 0 deletions

View File

@ -668,6 +668,17 @@ if (BUILDSWIGNODE)
endmacro(createpackagejson)
endif(BUILDSWIGNODE)
# Cordova binding
if (BUILDCORDOVA)
add_custom_target(cordova_binding ALL
COMMAND upm-cordova-binding ${CMAKE_BINARY_DIR}/src ${CMAKE_BINARY_DIR}/cordova ${VERSION}
COMMENT "Building cordova bindings based on swig java modules")
install(DIRECTORY ${CMAKE_BINARY_DIR}/cordova
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT ${CMAKE_PROJECT_NAME}-cordova)
endif (BUILDCORDOVA)
# Process C/C++ sensor modules
# This function pre-processes sensor library input and hands off the
# necessary global variables to upm_module_init for library creation,
@ -821,6 +832,13 @@ function(upm_module_init)
endif (BUILDSWIGJAVA)
endif (NOT IS_C_LIBRARY)
# Skip if the libname is in the blacklist
if (BUILDCORDOVA)
if (NOT IS_C_LIBRARY AND NOT ";${JAVASWIG_BLACKLIST};" MATCHES ";${libname};")
add_dependencies(cordova_binding javaupm_${libname})
endif()
endif (BUILDCORDOVA)
# Add additional properties to this target (used later for .pc/pom file creation)
set_target_properties(${libname} PROPERTIES PKG_CONFIG_NAME "${libprefix}${basename}")
set_target_properties(${libname} PROPERTIES PKG_CONFIG_DESCRIPTION "${libdescription}")