summaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d/02-macros.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>2018-10-15 18:22:47 +0200
commita622e2befa214d5ac0dfdff1f5f228d370a51c7d (patch)
tree1b260ff78d28541be03dacb7ca9196b584dc135d /cmake/cmake.d/02-macros.cmake
parent27c2ac3b100d4fd0d1ac80be1fd7429da9a4a1a7 (diff)
Use recommended way to specify target dependencies
Change-Id: I6a8e5d435a0540522de555f521d24aa4de21050d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake/cmake.d/02-macros.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)