Skip to content

Commit

Permalink
Add git checkout before patching. (#20)
Browse files Browse the repository at this point in the history
This ensures that on subsequent runs, if the patch step is run
again it will successfully repatch.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette authored Jan 28, 2021
1 parent 4030b89 commit c614081
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ macro(build_uncrustify)
ExternalProject_Add(uncrustify-0.68.1
GIT_REPOSITORY https://github.com/uncrustify/uncrustify.git
GIT_TAG ${uncrustify_version}
GIT_CONFIG advice.detachedHead=false
TIMEOUT 600
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_install
${extra_cmake_args}
-Wno-dev
PATCH_COMMAND
${CMAKE_COMMAND} -E chdir <SOURCE_DIR> git apply -p1 --ignore-space-change --whitespace=nowarn ${CMAKE_CURRENT_SOURCE_DIR}/install-patch.diff
${CMAKE_COMMAND} -E chdir <SOURCE_DIR> git checkout -q . && ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> git apply -p1 --ignore-space-change --whitespace=nowarn ${CMAKE_CURRENT_SOURCE_DIR}/install-patch.diff
)

# The external project will install to the build folder, but we'll install that on make install.
Expand Down

0 comments on commit c614081

Please sign in to comment.