Skip to content

Commit

Permalink
remove folder if exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed May 23, 2024
1 parent 2feffc1 commit d6d6578
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMake/json-download.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ 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 ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)



0 comments on commit d6d6578

Please sign in to comment.