summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-14 13:31:47 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:22:47 +0200
commit6095267fb32db35a2c785f11e9fb4d01ced7af26 (patch)
tree5914baf94bdd53147fa90d6436393c8972e8aed0 /cmake
parent145be000aa7243becc25d8d8fd9c92c83f302e2c (diff)
Handle controller plugin populate and install
Change-Id: Ib48817e4634990b6369de29ce81fa86354d73652 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/cmake.d/03-macros.cmake23
1 files changed, 16 insertions, 7 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake
index ed0800b..8af81d6 100644
--- a/cmake/cmake.d/03-macros.cmake
+++ b/cmake/cmake.d/03-macros.cmake
@@ -215,6 +215,7 @@ macro(project_targets_populate)
set(POPULE_PACKAGE_TARGET "project_populate_${TARGET}")
get_target_property(P ${TARGET} PREFIX)
+ get_target_property(S ${TARGET} SUFFIX)
get_target_property(BD ${TARGET} BINARY_DIR)
get_target_property(SD ${TARGET} SOURCE_DIR)
get_target_property(OUT ${TARGET} OUTPUT_NAME)
@@ -227,16 +228,24 @@ macro(project_targets_populate)
endif()
endif()
- if(${T} STREQUAL "BINDING")
- list(APPEND BINDINGS_LIST "${P}${OUT}")
- add_custom_command(OUTPUT ${PACKAGE_LIBDIR}/${P}${OUT}.so
- DEPENDS ${BD}/${P}${OUT}.so
+ if(${T} STREQUAL "BINDING" OR ${T} STREQUAL "PLUGIN")
+ if(NOT S)
+ list(APPEND BINDINGS_LIST "${P}${OUT}")
+ set(S ".so")
+ else()
+ set(PACKAGE_LIBDIR_BCK "${PACKAGE_LIBDIR}")
+ set(PACKAGE_LIBDIR "${PACKAGE_LIBDIR}/plugins")
+ endif()
+
+ add_custom_command(OUTPUT ${PACKAGE_LIBDIR}/${P}${OUT}${S}
+ DEPENDS ${BD}/${P}${OUT}${S}
COMMAND mkdir -p ${PACKAGE_LIBDIR}
- COMMAND cp ${BD}/${P}${OUT}.so ${PACKAGE_LIBDIR}
+ COMMAND cp ${BD}/${P}${OUT}${S} ${PACKAGE_LIBDIR}
)
- add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_LIBDIR}/${P}${OUT}.so)
+ add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_LIBDIR}/${P}${OUT}${S})
add_dependencies(populate ${POPULE_PACKAGE_TARGET})
add_dependencies(${POPULE_PACKAGE_TARGET} ${TARGET})
+ set(PACKAGE_LIBDIR ${PACKAGE_LIBDIR_BCK})
elseif(${T} STREQUAL "BINDINGV2")
if (OPENAPI_DEF)
add_custom_command(OUTPUT ${SD}/${OPENAPI_DEF}.h
@@ -315,7 +324,7 @@ macro(project_targets_populate)
)
add_dependencies(populate ${POPULE_PACKAGE_TARGET})
add_dependencies(${POPULE_PACKAGE_TARGET} ${TARGET})
- endif(${T} STREQUAL "BINDING")
+ endif()
elseif(${CMAKE_BUILD_TYPE} MATCHES "[Dd][Ee][Bb][Uu][Gg]")
MESSAGE("${Yellow}.. Warning: ${TARGET} ignored when packaging.${ColourReset}")
endif()