# Run configure step only for specific target

**URL:** https://discourse.cmake.org/t/run-configure-step-only-for-specific-target/8607
**Category:** Usage
**Tags:** os:linux, gen:ninja
**Created:** [July 26, 2023, 2:44pm UTC](https://discourse.cmake.org/t/run-configure-step-only-for-specific-target/8607 "2023-07-26T14:44:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![GTP](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@GTP](https://discourse.cmake.org/u/GTP)
#### Post date: [July 26, 2023, 2:44pm UTC](https://discourse.cmake.org/t/run-configure-step-only-for-specific-target/8607/1 "2023-07-26T14:44:52Z")

</div>

Greetings,

Is it possible to run the configuration step only for a specific target instead of for the whole CMake project?

I’m trying to compile a project’s component to WASM using Emscripten. This means that I have to modify CMake’s config to point to WASM versions of the project’s dependencies. If I could run the configure step only for the specific target I’m interested in, I could avoid modifying the configuration for other targets that require additional dependencies and look for/build WASM versions of those dependencies. Looking on StackOverflow turned out [this](https://stackoverflow.com/questions/70945720/what-happened-to-cmakes-target-argument), that makes me think that maybe there isn’t an option for this. But I would like a confirmation, as such a feature could be a lifesaver in my situation.  
Thank you for your help,

GTP

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [July 26, 2023, 4:53pm UTC](https://discourse.cmake.org/t/run-configure-step-only-for-specific-target/8607/2 "2023-07-26T16:53:11Z")

</div>

No, that’s not something CMake supports. Your best bet is probably to comment out directories and use `if (FALSE)` to block out code you don’t want.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [July 26, 2023, 4:53pm UTC](https://discourse.cmake.org/t/run-configure-step-only-for-specific-target/8607/3 "2023-07-26T16:53:35Z")

</div>

Well, best would be to have the project support turning off bits with configure flags, but that’s something to discuss with the project’s maintainers.
