# Exceptions to the default target

**URL:** https://discourse.cmake.org/t/exceptions-to-the-default-target/13599
**Category:** Development
**Created:** [February 18, 2025, 3:37pm UTC](https://discourse.cmake.org/t/exceptions-to-the-default-target/13599 "2025-02-18T15:37:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nmnobre](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nmnobre/32/5356_2.png) [@nmnobre](https://discourse.cmake.org/u/nmnobre)
#### Post date: [February 18, 2025, 3:37pm UTC](https://discourse.cmake.org/t/exceptions-to-the-default-target/13599/1 "2025-02-18T15:37:01Z")

</div>

The docs describe the built-in `all` target as:

“The default target used by `Makefile` and `Ninja` generators. Builds all targets in the buildsystem, except those which are excluded by their [`EXCLUDE_FROM_ALL`](https://cmake.org/cmake/help/latest/prop_tgt/EXCLUDE_FROM_ALL.html#prop_tgt:EXCLUDE_FROM_ALL) target property or [`EXCLUDE_FROM_ALL`](https://cmake.org/cmake/help/latest/prop_dir/EXCLUDE_FROM_ALL.html#prop_dir:EXCLUDE_FROM_ALL) directory property. The name `ALL_BUILD` is used for this purpose for the Xcode and Visual Studio generators.”

My question is simply if custom targets created with `add_custom_target`, which are not included in the `all` target unless the `ALL` option is enabled, are covered by the text above? It doesn’t look like they are, in which case I think it’d be good to add a note?

Cheers,  
Nuno

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [February 18, 2025, 5:01pm UTC](https://discourse.cmake.org/t/exceptions-to-the-default-target/13599/2 "2025-02-18T17:01:02Z")

</div>

For reference, the quoted documentation is in the User Interaction Guide [here](https://cmake.org/cmake/help/v3.31/guide/user-interaction/index.html#selecting-a-target).

`add_custom_target` without `ALL` is indeed not in the `all` target. The guide could be clarified.
