 -  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

 install(DIRECTORY cmake DESTINATION share/${PROJECT_NAME})
-
-ament_package(CONFIG_EXTRAS zstd_vendor-extras.cmake)

From d7015b84fbf81615f4efa96ef8cf81461c133bd0 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
