From 77813a98067d7a90214e96f3fc4f1ee93d8c45c8 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 9 Aug 2017 18:44:16 +0200 Subject: Generate .h from OpenAPI json description file Use a new label BINDINGV2 that create a new target ${TARGET}_GENSKEL before build ${TARGET}. Change-Id: I358e65f0340ac051217cb19a4554f6165af061df Signed-off-by: Romain Forlot --- cmake/cmake.d/02-macros.cmake | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/cmake.d/02-macros.cmake b/cmake/cmake.d/02-macros.cmake index 3713d80..6ebff21 100644 --- a/cmake/cmake.d/02-macros.cmake +++ b/cmake/cmake.d/02-macros.cmake @@ -87,10 +87,23 @@ macro(project_targets_populate) COMMAND mkdir -p ${PACKAGE_LIBDIR} COMMAND cp ${BD}/${P}${OUT}.so ${PACKAGE_LIBDIR} ) -message ("DEPENDS ${BD}/${P}${OUT}.so") add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_LIBDIR}/${P}${OUT}.so) add_dependencies(populate ${POPULE_PACKAGE_TARGET}) add_dependencies(${POPULE_PACKAGE_TARGET} ${TARGET}) + elseif(${T} STREQUAL "BINDINGV2") + add_custom_command(OUTPUT ${PACKAGE_LIBDIR}/${P}${OUT}.so + DEPENDS ${BD}/${P}${OUT}.so + COMMAND mkdir -p ${PACKAGE_LIBDIR} + COMMAND cp ${BD}/${P}${OUT}.so ${PACKAGE_LIBDIR} + ) + add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_LIBDIR}/${P}${OUT}.so) + + add_custom_command(OUTPUT ${SD}/${P}${OUT}.h + DEPENDS ${SD}/${P}${OUT}.json + COMMAND afb-genskel ${SD}/${P}${OUT}.json > ${SD}/${P}${OUT}.h + ) + add_custom_target("${TARGET}_GENSKEL" DEPENDS ${SD}/${P}${OUT}.h) + add_dependencies(${TARGET} "${TARGET}_GENSKEL") elseif(${T} STREQUAL "EXECUTABLE") add_custom_command(OUTPUT ${PACKAGE_BINDIR}/${P}${OUT} DEPENDS ${BD}/${P}${OUT} -- cgit 1.2.3-korg