From d6d6578b9d45288938c900aaced2e33b86b0504e Mon Sep 17 00:00:00 2001 From: Nir Azkiel Date: Thu, 23 May 2024 18:27:27 +0300 Subject: [PATCH] remove folder if exist --- CMake/json-download.cmake.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMake/json-download.cmake.in b/CMake/json-download.cmake.in index 0133c4a973..9f3d37ca0b 100644 --- a/CMake/json-download.cmake.in +++ b/CMake/json-download.cmake.in @@ -9,8 +9,11 @@ ExternalProject_Add( # We do not use 'GIT_REPOSITORY' as it doesn't support a shallow clone of a specific commit, # this make the clone step very long, so we clone by ourselves (See https://gitlab.kitware.com/cmake/cmake/-/issues/17770). # Adding detachedHead=false to avoid warnings like: "You are in 'detached HEAD' state..." - DOWNLOAD_COMMAND git clone -c advice.detachedHead=false --branch v3.11.3 https://github.com/nlohmann/json.git --depth 1 json - DOWNLOAD_DIR "${CMAKE_BINARY_DIR}/third-party/" + # 'remove_directory' is working but cound as deprecated from cmake version 3.17, + # Once we have a minimal version support of cmake 3.17, we can switch the command to rm -rF + DOWNLOAD_COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_BINARY_DIR}/third-party/json" + COMMAND git clone -c advice.detachedHead=false --branch v3.11.3 https://github.com/nlohmann/json.git --depth 1 json + DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/third-party/ # Override default steps with no action, we just want the clone step. UPDATE_COMMAND "" @@ -18,4 +21,5 @@ ExternalProject_Add( BUILD_COMMAND "" INSTALL_COMMAND "" ) - + +