# using build preset with ExternalProject\_Add

**URL:** https://discourse.cmake.org/t/using-build-preset-with-externalproject-add/12902
**Category:** Code
**Created:** [November 6, 2024, 5:35am UTC](https://discourse.cmake.org/t/using-build-preset-with-externalproject-add/12902 "2024-11-06T05:35:21Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![fws](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fws/32/5104_2.png) [@fws](https://discourse.cmake.org/u/fws)
#### Post date: [November 6, 2024, 9:32am UTC](https://discourse.cmake.org/t/using-build-preset-with-externalproject-add/12902/7 "2024-11-06T09:32:06Z")

</div>

no they are not submodules, I am already using CMakePresets at SubProject level for the configuration step of the SubProject they already work. But I don’t know how to also use the build preset during build step. I am using the SubProject standalone I can use:

```auto
cmake -B ./build/xyz_a --preset=a
cmake --build ./build/xyz_a --preset=a

cmake -B ./build/xyz_b --preset=b
cmake --build ./build/xyz_b --preset=b

```

and the behavior is as I would expected but if I am using

```auto
ExternalProject_Add(ScuSoftwareLinux 
                    SOURCE_DIR "${CMAKE_SOURCE_DIR}/SubProject/"
                    STEP_TARGETS build 
                    CMAKE_ARGS --preset=a
                    )

```

the build behaves as I would run in the SubProjects directory

```auto
cmake -B ./build/xyz_a --preset=a
cmake --build ./build/xyz_a

```

---

_[View the full topic](https://discourse.cmake.org/t/using-build-preset-with-externalproject-add/12902)._
