        ${extra_cmake_args}
        -Wno-dev
 -    PATCH_COMMAND
--      ${Patch_EXECUTABLE} -p1 -N < ${CMAKE_CURRENT_SOURCE_DIR}/install-patch.diff
+-      ${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.

From 1ae036f38bb3e835f82b0c0e3493a8f9decae59a Mon Sep 17 00:00:00 2001
From: Martin Jansa <martin.jansa@lge.com>
Date: Mon, 27 Jul 2020 09:56:44 -0700
Subject: [PATCH] CMakeLists.txt: fetch uncrustify with bitbake fetcher

 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 22b2549..d06eb1b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,19 +42,11 @@ macro(build_uncrustify)
   set(uncrustify_version 45b836cff040594994d364ad6fd3f04adc890a26)
   # Get uncrustify 0.68.1
   ExternalProject_Add(uncrustify-${uncrustify_version}
-    GIT_REPOSITORY https://github.com/uncrustify/uncrustify.git
-    GIT_TAG ${uncrustify_version}
-    GIT_CONFIG advice.detachedHead=false
-    # Suppress git update due to https://gitlab.kitware.com/cmake/cmake/-/issues/16419
-    # See https://github.com/ament/uncrustify_vendor/pull/22 for details
-    UPDATE_COMMAND ""
-    TIMEOUT 600
+    SOURCE_DIR ${CMAKE_SOURCE_DIR}/uncrustify-upstream
     CMAKE_ARGS
