# FetchContent\_Declare with CMAKE\_ARGS does not work

**URL:** https://discourse.cmake.org/t/fetchcontent-declare-with-cmake-args-does-not-work/11227
**Category:** Usage
**Created:** [July 12, 2024, 9:38am UTC](https://discourse.cmake.org/t/fetchcontent-declare-with-cmake-args-does-not-work/11227 "2024-07-12T09:38:08Z")
**Posts on this page:** 1
**Showing post:** 7

<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: [July 13, 2024, 5:56am UTC](https://discourse.cmake.org/t/fetchcontent-declare-with-cmake-args-does-not-work/11227/7 "2024-07-13T05:56:37Z")

</div>

CMAKE\_ARGS has never been supported for any version of FetchContent. Regardless of whether you were using `FetchContent_Populate()` or `FetchContent_MakeAvailable()`, the configure step has never been invoked by the sub-build. Whatever you were expecting CMAKE\_ARGS to do, it wasn’t having any effect and at best was being silently ignored (and continues to be).

> How am I to set cmake configure args for this?

I explained what you need to do in my previous reply. It would look something like this (with the caveats as noted in that previous reply):

```cmake
include(FetchContent)

FetchContent_Declare(
    glfw
    GIT_REPOSITORY https://github.com/glfw/glfw.git
    SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/glfw-src"
    GIT_TAG "master"
    GIT_SHALLOW TRUE
)
set(GLFW_BUILD_WAYLAND ON)
set(GLFW_BUILD_X11 OFF)
FetchContent_MakeAvailable(glfw)

```

---

_[View the full topic](https://discourse.cmake.org/t/fetchcontent-declare-with-cmake-args-does-not-work/11227)._
