# FetchContent\_Declare with temporarily unreachable repositories

**URL:** https://discourse.cmake.org/t/fetchcontent-declare-with-temporarily-unreachable-repositories/3908
**Category:** Usage
**Tags:** os:windows
**Created:** [August 11, 2021, 4:34pm UTC](https://discourse.cmake.org/t/fetchcontent-declare-with-temporarily-unreachable-repositories/3908 "2021-08-11T16:34:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rhodanos](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rhodanos](https://discourse.cmake.org/u/rhodanos)
#### Post date: [August 11, 2021, 4:34pm UTC](https://discourse.cmake.org/t/fetchcontent-declare-with-temporarily-unreachable-repositories/3908/1 "2021-08-11T16:34:52Z")

</div>

Hi everybody,

I’ve recently started using the methods around FetchContent\_Declare to pull my external project components (Git, SVN) to my current CMake project and it works great so far. Today however was the first time I’ve tried to configure the project while my PC was not connected to our VPN. Obviously, at the first call of FetchContent\_Declare or maybe the first call to FetchContent\_MakeAvailable (don’t know where the error comes from exactly) CMake send out an error and stopped the configure process, because the repository URL could not be reached. I don’t know if this can somehow be avoided, because there were no updates or any changes in the repository anyway, but I could not continue working until I reconnected to the VPN. Wouldn’t it suffice to throw a warning here instead of an error? In case the external projects have been made available at least once the subdirectories should be available for a correct CMake configure/generate step.

Is there a way to implement this behavior atm?

Any insights or help would be greatly appreciated.

Best regards,  
Matthias

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [August 11, 2021, 4:39pm UTC](https://discourse.cmake.org/t/fetchcontent-declare-with-temporarily-unreachable-repositories/3908/2 "2021-08-11T16:39:25Z")

</div>

Cc: @craig.scott

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [August 11, 2021, 10:23pm UTC](https://discourse.cmake.org/t/fetchcontent-declare-with-temporarily-unreachable-repositories/3908/3 "2021-08-11T22:23:59Z")

</div>

Take a look at the `FETCHCONTENT_UPDATES_DISCONNECTED` variable. It is intended for pretty much your exact scenario. `FETCHCONTENT_FULLY_DISCONNECTED` may also be appropriate, depending on your situation and personal preferences.

---

<div class="post-metadata">

### Author: ![rhodanos](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rhodanos](https://discourse.cmake.org/u/rhodanos)
#### Post date: [August 12, 2021, 6:02am UTC](https://discourse.cmake.org/t/fetchcontent-declare-with-temporarily-unreachable-repositories/3908/4 "2021-08-12T06:02:53Z")

</div>

That’s exactly what I was looking for. I don’t know how I missed it. I should read the documentation more carefully next time. Thank you Craig.
