Skip to content

Commit f44a937

Browse files
authored
Fix patch file dependencies in ament_cmake_vendor_package (#520)
When patch files are changed, re-download the sources to get a clean slate to re-apply the changed patch files. Signed-off-by: Scott K Logan <[email protected]>
1 parent c1cf011 commit f44a937

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ament_cmake_vendor_package/cmake/ament_vendor.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ function(_ament_vendor TARGET_NAME VCS_TYPE VCS_URL VCS_VERSION PATCHES CMAKE_AR
269269
find_program(vcs_EXECUTABLE vcs REQUIRED)
270270
list(
271271
APPEND EXTERNALPROJECT_ARGS
272+
DOWNLOAD_COMMAND "${CMAKE_COMMAND}" -E rm -rf <SOURCE_DIR> &&
273+
DOWNLOAD_COMMAND "${CMAKE_COMMAND}" -E make_directory <SOURCE_DIR> &&
272274
DOWNLOAD_COMMAND "${vcs_EXECUTABLE}" import . --input "${REPOS_FILE}" --shallow --recursive --force
273275
SOURCE_SUBDIR ${SOURCE_SUBDIR}
274276
)
@@ -288,7 +290,7 @@ function(_ament_vendor TARGET_NAME VCS_TYPE VCS_URL VCS_VERSION PATCHES CMAKE_AR
288290

289291
externalproject_add_stepdependencies(${TARGET_NAME} download ${REPOS_FILE})
290292
if(PATCH_FILES)
291-
externalproject_add_stepdependencies(${TARGET_NAME} patch ${PATCH_FILES})
293+
externalproject_add_stepdependencies(${TARGET_NAME} download ${PATCH_FILES})
292294
endif()
293295
if(VCS_TYPE STREQUAL "path")
294296
file(GLOB_RECURSE SOURCE_FILES

0 commit comments

Comments
 (0)