 -  endif()
 -  list(APPEND extra_cmake_args "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}")
 -
+-  set(zstd_version 1.4.4)
 -  include(ExternalProject)
 -  # The CMakeLists.txt file for zstd is in a subdirectory.
 -  # We need to configure the CMake command to build from there instead.
--  ExternalProject_Add(zstd-1.4.4
--    URL https://github.com/facebook/zstd/archive/v1.4.4.zip
--    URL_MD5 3a5c3a535280b7f4dfdbd739fcc7173f
+-  ExternalProject_Add(zstd-${zstd_version}
+-    GIT_REPOSITORY https://github.com/facebook/zstd.git
+-    GIT_TAG v${zstd_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 60
 -    SOURCE_SUBDIR build/cmake
 -    CMAKE_ARGS

From cb89d94b75fad2710b60ada8eb4fb9cc3550b359 Mon Sep 17 00:00:00 2001
From: Martin Jansa <martin.jansa@lge.com>
Date: Fri, 5 Jun 2020 11:35:25 -0700
Subject: [PATCH] CMakeLists.txt: prevent building zstd with ExternalProject


Signed-off-by: Martin Jansa <martin.jansa@lge.com>
---
 CMakeLists.txt                      | 56 +++--------------------------
 cmake_minimum_required_2.8.12.patch | 26 --------------
 no_internal_headers.patch           | 28 ---------------
 3 files changed, 4 insertions(+), 106 deletions(-)
 delete mode 100644 cmake_minimum_required_2.8.12.patch
 delete mode 100644 no_internal_headers.patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0819c337..78efbc22 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,62 +9,14 @@ option(FORCE_BUILD_VENDOR_PKG
   OFF)
 
 if(NOT FORCE_BUILD_VENDOR_PKG)
