aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-07-10 13:51:49 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-07-10 13:51:49 +0200
commit8d4708894c2322b8b6e0a4d9fe73175251a1febf (patch)
tree361303c7ff44cf4ab2afbe66cb41604e9e150e72 /cmake
parentd732f49b9a7a97efe6e24cb734b446079e7182db (diff)
Use recommended way to specify target dependencies
Change-Id: I6a8e5d435a0540522de555f521d24aa4de21050d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/cmake.d/02-macros.cmake18
1 files changed, 7 insertions, 11 deletions
diff --git a/cmake/cmake.d/02-macros.cmake b/cmake/cmake.d/02-macros.cmake
index ace7533..77b7f3a 100644
--- a/cmake/cmake.d/02-macros.cmake
+++ b/cmake/cmake.d/02-macros.cmake
@@ -79,39 +79,35 @@ macro(project_targets_populate)
endif()
if(${T} STREQUAL "BINDING")
- add_custom_command(OUTPUT ${PACKAGE_LIBDIR}/${P}${TARGET}.so
- DEPENDS ${TARGET}
+ add_custom_command(OUTPUT ${PACKAGE_LIBDIR}/${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}${TARGET}.so)
- add_dependencies(populate ${POPULE_PACKAGE_TARGET})
+ add_dependencies(populate ${POPULE_PACKAGE_TARGET} ${TARGET})
elseif(${T} STREQUAL "EXECUTABLE")
- add_custom_command(OUTPUT ${PACKAGE_BINDIR}/${P}${TARGET}
- DEPENDS ${TARGET}
+ add_custom_command(OUTPUT ${PACKAGE_BINDIR}/${P}${OUT}
COMMAND mkdir -p ${PACKAGE_BINDIR}
COMMAND cp ${BD}/${P}${OUT} ${PACKAGE_BINDIR}
)
add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_BINDIR}/${P}${TARGET})
- add_dependencies(populate ${POPULE_PACKAGE_TARGET})
+ add_dependencies(populate ${POPULE_PACKAGE_TARGET} ${TARGET})
elseif(${T} STREQUAL "HTDOCS")
add_custom_command(OUTPUT ${PACKAGE_HTTPDIR}-xx
- DEPENDS ${TARGET}
COMMAND mkdir -p ${PACKAGE_HTTPDIR}
COMMAND touch ${PACKAGE_HTTPDIR}
COMMAND cp -r ${BD}/${P}${OUT}/* ${PACKAGE_HTTPDIR}
)
add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_HTTPDIR}-xx)
- add_dependencies(populate ${POPULE_PACKAGE_TARGET})
+ add_dependencies(populate ${POPULE_PACKAGE_TARGET} ${TARGET})
elseif(${T} STREQUAL "DATA")
add_custom_command(OUTPUT ${PACKAGE_DATADIR}-xx
- DEPENDS ${TARGET}
COMMAND mkdir -p ${PACKAGE_DATADIR}
COMMAND touch ${PACKAGE_DATADIR}
COMMAND cp -r ${BD}/${P}${OUT}/* ${PACKAGE_DATADIR}
)
add_custom_target(${POPULE_PACKAGE_TARGET} DEPENDS ${PACKAGE_DATADIR}-xx)
- add_dependencies(populate ${POPULE_PACKAGE_TARGET})
+ add_dependencies(populate ${POPULE_PACKAGE_TARGET} ${TARGET})
endif(${T} STREQUAL "BINDING")
elseif(${CMAKE_BUILD_TYPE} MATCHES "[Dd][Ee][Bb][Uu][Gg]")
MESSAGE(".. Warning: ${TARGET} ignored when packaging.")
@@ -144,11 +140,11 @@ macro(remote_targets_populate)
configure_files_in_dir(${GDB_TEMPLATE_DIR})
add_custom_target(remote-target-populate
- DEPENDS populate
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/target/*.sh
COMMAND rsync -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --archive --delete ${PROJECT_PKG_BUILD_DIR}/ ${RSYNC_TARGET}:${RSYNC_PREFIX}/${PROJECT_NAME}
COMMENT "${REMOTE_LAUNCH}"
)
+ add_dependencies(remote-target-populate populate)
endif()
endmacro(remote_targets_populate)