# Where is $\<COMMAND\_CONFIG:...\> allowed?

**URL:** https://discourse.cmake.org/t/where-is-command-config-allowed/3998
**Category:** Usage
**Created:** [August 30, 2021, 12:37pm UTC](https://discourse.cmake.org/t/where-is-command-config-allowed/3998 "2021-08-30T12:37:43Z")
**Posts on this page:** 2
**Page:** 1

<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 30, 2021, 12:37pm UTC](https://discourse.cmake.org/t/where-is-command-config-allowed/3998/1 "2021-08-30T12:37:43Z")

</div>

The documentation for the `$<COMMAND_CONFIG:...>` generator expression (introduced in CMake 3.20) is a bit ambiguous regarding where it is allowed to be used. It states the following:

> Only valid in `add_custom_command()` and `add_custom_target()` as the outer-most generator expression in an argument.

What is meant by “argument” here? Does this mean that it can only appear in a `COMMAND`, or does “argument” refer to any argument of `add_custom_command()` or `add_custom_target()`? Put another way, is it legal to use `$<COMMAND_CONFIG:...>` in something listed after `DEPENDS`?

This arose in a recent Qt code review. It would be nice to get clarification so we understand what is intended to be formally supported and what isn’t.

@kyle.edwards

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [August 30, 2021, 12:39pm UTC](https://discourse.cmake.org/t/where-is-command-config-allowed/3998/2 "2021-08-30T12:39:53Z")

</div>

I believe it is valid in `DEPENDS` as well. The idea is to allow dependency on the same config as the output or, in this case, the cross-config feature where a `Release` tool can be used in a `Debug` custom command.
