# Changing old FetchContent to comply with new restrictions

**URL:** <https://discourse.cmake.org/t/changing-old-fetchcontent-to-comply-with-new-restrictions/11253>\
**Category:** Code\
**Created:** [July 15, 2024, 2:40pm UTC](https://discourse.cmake.org/t/changing-old-fetchcontent-to-comply-with-new-restrictions/11253 "2024-07-15T14:40:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen](https://discourse.cmake.org/user_avatar/discourse.cmake.org/allen/32/4767_2.png) [@Allen](https://discourse.cmake.org/u/Allen)\
**Post date:** [July 15, 2024, 2:40pm UTC](https://discourse.cmake.org/t/changing-old-fetchcontent-to-comply-with-new-restrictions/11253/1 "2024-07-15T14:40:48Z")

</div>

We converted our ExternalProject code to use FetchContent\_Declare/FetchContent\_Populate and allow us to copy files/set args before calling add\_subdirectory. This worked very well until the latest version changed restrictions on FetchContent\_Populate.  
I have tried to change to FetchConent\_MakeAvailable without success.  
The question is can I copy a file to the downloaded source before MakeAvailable activates?

Allen @ The HDFGroup

---

<div class="post-metadata">

**Author:** ![Allen](https://discourse.cmake.org/user_avatar/discourse.cmake.org/allen/32/4767_2.png) [@Allen](https://discourse.cmake.org/u/Allen)\
**Post date:** [July 15, 2024, 7:57pm UTC](https://discourse.cmake.org/t/changing-old-fetchcontent-to-comply-with-new-restrictions/11253/2 "2024-07-15T19:57:28Z")

</div>

Looks like I just needed to search the CMake repo for examples of PATCH\_COMMAND in FetchContent\_Declare instances for the answer. Would be nice to have examples in the docs!

Tests/MFC/CMakeLists.txt - line 17/33
