summaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-08-09 18:44:16 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:22:47 +0200
commit9b9e535a004aac85e97f57a0145e27ee95038a61 (patch)
tree2a8de71705c8227c5c1c8926793e989d2ef6616c /cmake/cmake.d
parentacd567d887421bd2d3705ac686686c9a980475bc (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>
Diffstat (limited to 'cmake/cmake.d')
-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}