Etwus
Etwus

Reputation: 619

CMake FetchContent show download progress

Is there some way to show download progress while downloading git repository using FetchContent?

I tried to clear FETCHCONTENT_QUIET, but it did nothing. I have no idea if it is even possible.

Upvotes: 15

Views: 7170

Answers (2)

Chris_128
Chris_128

Reputation: 457

To see git clone progress, you need to set both FetchContent_Quiet and GIT_PROGRESS as in the below example

Set(FETCHCONTENT_QUIET FALSE)

FetchContent_Declare(
  someTarget
  GIT_REPOSITORY "https://github.com/someone/someTarget.git"
  GIT_TAG "tag"
  GIT_PROGRESS TRUE
)

Upvotes: 26

Etwus
Etwus

Reputation: 619

I just figured out that I have to use GIT_PROGRESS <bool> in FetchContent_Declare.

FetchContent_Declare(
  someTarget
  GIT_REPOSITORY "https://github.com/someone/someTarget.git"
  GIT_TAG "tag"
  GIT_PROGRESS TRUE
)

Upvotes: 4

Related Questions