FetchContent: GIT_SHALLOW does not seem to work
Expected behavior according to the documentation:
When this option is enabled, the git clone operation will be given the --depth 1 option.
However, the whole history is still downloaded when the option is set to ON, with CMake 3.17.5.
Reproducible example with a big repository of 2.2 GB: cmake_minimum_required(VERSION 3.16) project(test_git_shallow)
include(FetchContent)
FetchContent_Declare(
openfast
GIT_REPOSITORY https://github.com/OpenFAST/openfast.git
GIT_TAG v2.2.0
GIT_SHALLOW ON
GIT_SUBMODULES ""
)
FetchContent_GetProperties(openfast)
if(NOT openfast_POPULATED)
FetchContent_Populate(openfast)
endif()