summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-12-21 16:57:51 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-21 16:57:51 +0100
commitbb3c5413dd0e2ff098a99748a53be1c66186f235 (patch)
treea6228f623e8a18cb05b9d0bd0ace14daa942a9b5
parentee5d60f9d169d959cca9dc24cfc3776ed06c163c (diff)
Use new CPP generation from afb-genskel
Include a new options calling afb-genskel depending on PROJECT_LANGUAGES variable Change-Id: Id7719b399eac58f0ced54a49e09350a587e4e997 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--cmake/cmake.d/03-macros.cmake7
-rw-r--r--samples.d/config.cmake.sample2
2 files changed, 6 insertions, 3 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake
index 207e85a..61fc0dc 100644
--- a/cmake/cmake.d/03-macros.cmake
+++ b/cmake/cmake.d/03-macros.cmake
@@ -247,10 +247,13 @@ endmacro()
# To be call inside project_targets_populate macro
macro(afb_genskel)
+ if ("${PROJECT_LANGUAGES}" MATCHES "CXX")
+ list(APPEND GENSKEL_OPTS "--cpp")
+ endif()
if (OPENAPI_DEF)
add_custom_command(OUTPUT ${SD}/${OPENAPI_DEF}.h
DEPENDS ${SD}/${OPENAPI_DEF}.json
- COMMAND afb-genskel ${SD}/${OPENAPI_DEF}.json > ${SD}/${OPENAPI_DEF}.h
+ COMMAND afb-genskel ${GENSKEL_OPTS} ${SD}/${OPENAPI_DEF}.json > ${SD}/${OPENAPI_DEF}.h
)
add_custom_target("${TARGET}_GENSKEL" DEPENDS ${SD}/${OPENAPI_DEF}.h
COMMENT "Generating OpenAPI header file ${OPENAPI_DEF}.h")
@@ -258,7 +261,7 @@ macro(afb_genskel)
else()
add_custom_command(OUTPUT ${SD}/${OUT}-apidef.h
DEPENDS ${SD}/${OUT}-apidef.json
- COMMAND afb-genskel ${SD}/${OUT}-apidef.json > ${SD}/${OUT}-apidef.h
+ COMMAND afb-genskel ${GENSKEL_OPTS} ${SD}/${OUT}-apidef.json > ${SD}/${OUT}-apidef.h
)
add_custom_target("${TARGET}_GENSKEL" DEPENDS ${SD}/${OUT}-apidef.h
COMMENT "Generating OpenAPI header file ${OUT}-apidef.h")
diff --git a/samples.d/config.cmake.sample b/samples.d/config.cmake.sample
index 7444a7c..1b6302e 100644
--- a/samples.d/config.cmake.sample
+++ b/samples.d/config.cmake.sample
@@ -26,7 +26,7 @@ set(PROJECT_ICON "icon.png")
set(PROJECT_AUTHOR "Last Name, First Name")
set(PROJECT_AUTHOR_MAIL "example.man@bigouden.bzh")
set(PROJECT_LICENSE "APL2.0")
-set(PROJECT_LANGUAGES,"C")
+set(PROJECT_LANGUAGES "C")
# Where are stored default templates files from submodule or subtree app-templates in your project tree
# relative to the root project directory