aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-08-09 18:44:16 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-08-09 18:44:16 +0200
commit77813a98067d7a90214e96f3fc4f1ee93d8c45c8 (patch)
tree95ea65b2585f4974dfa35766e5f976b5f267097c
parent265fa8466ca1bd089abf36e44fa04f1bc9c1533a (diff)
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 <romain.forlot@iot.bzh>
-rw-r--r--cmake/cmake.d/02-macros.cmake15
1 files changed, 14 insertions, 1 deletions
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}