aboutsummaryrefslogtreecommitdiffstats
path: root/ucs2-afb/CMakeLists.txt
diff options
context:
space:
mode:
authorfulup <fulup.arfoll@iot.bzh>2017-07-19 15:18:25 +0200
committerFulup Ar Foll <fulup@iot.bzh>2017-07-25 12:37:22 +0200
commit475f9d3205488d590c3ee6d61c1a61279102e7b8 (patch)
tree8ae313ac6e1942b7e5d5513bacd4b251a14fcc4c /ucs2-afb/CMakeLists.txt
parent8d9802fb4f8510edfd6194d007bf4eb5776e4532 (diff)
Update Installation Documentation
Diffstat (limited to 'ucs2-afb/CMakeLists.txt')
-rw-r--r--ucs2-afb/CMakeLists.txt28
1 files changed, 22 insertions, 6 deletions
diff --git a/ucs2-afb/CMakeLists.txt b/ucs2-afb/CMakeLists.txt
index ee5099e..9bac628 100644
--- a/ucs2-afb/CMakeLists.txt
+++ b/ucs2-afb/CMakeLists.txt
@@ -16,28 +16,44 @@
# limitations under the License.
###########################################################################
+
+# Generate API-v2 hat from OpenAPI json definition
+macro(SET_TARGET_GENSKEL TARGET_NAME API_DEF_NAME)
+ add_custom_command(OUTPUT ${API_DEF_NAME}.h
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS ${API_DEF_NAME}.json
+ COMMAND afb-genskel ${API_DEF_NAME}.json >${API_DEF_NAME}.h
+ )
+ add_custom_target(${API_DEF_NAME}_OPENAPI DEPENDS ${API_DEF_NAME}.h)
+ add_dependencies(${TARGET_NAME} ${API_DEF_NAME}_OPENAPI)
+
+endmacro(SET_TARGET_GENSKEL)
+
# Add target to project dependency list
-PROJECT_TARGET_ADD(ucs2)
+PROJECT_TARGET_ADD(ucs2-afb)
# Define project Targets
- ADD_LIBRARY(ucs2 MODULE ucs_binding.c ucs_apihat.c)
+ ADD_LIBRARY(${TARGET_NAME} MODULE ucs_apihat.c ucs_binding.c )
+
+ # Generate API-v2 hat from OpenAPI json definition
+ SET_TARGET_GENSKEL(${TARGET_NAME} ucs_apidef)
# Binder exposes a unique public entry point
- SET_TARGET_PROPERTIES(ucs2 PROPERTIES
+ SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
PREFIX "afb-"
LABELS "BINDING"
LINK_FLAGS ${BINDINGS_LINK_FLAG}
- OUTPUT_NAME ${TARGET_NAME}
+ OUTPUT_NAME ucs2
)
# Library dependencies (include updates automatically)
- TARGET_LINK_LIBRARIES(ucs2
+ TARGET_LINK_LIBRARIES(${TARGET_NAME}
ucs2-inter
${link_libraries}
)
# installation directory
- INSTALL(TARGETS ucs2
+ INSTALL(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${BINDINGS_INSTALL_DIR})