# Toolchains and presets

**URL:** https://discourse.cmake.org/t/toolchains-and-presets/10742
**Category:** Usage
**Created:** [April 25, 2024, 1:42pm UTC](https://discourse.cmake.org/t/toolchains-and-presets/10742 "2024-04-25T13:42:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kentzo](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kentzo/32/4122_2.png) [@Kentzo](https://discourse.cmake.org/u/Kentzo)
#### Post date: [April 25, 2024, 1:42pm UTC](https://discourse.cmake.org/t/toolchains-and-presets/10742/1 "2024-04-25T13:42:27Z")

</div>

Is there a way to access variables specified in the toolchain file passed via the `--toolchain` or `-DCMAKE_TOOLCHAIN_FILE` from a preset?

---

<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: [April 27, 2024, 3:53pm UTC](https://discourse.cmake.org/t/toolchains-and-presets/10742/2 "2024-04-27T15:53:11Z")

</div>

I don’t think so as presets can define toolchain files.

Cc: @kyle.edwards

---

<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: [April 28, 2024, 5:31am UTC](https://discourse.cmake.org/t/toolchains-and-presets/10742/3 "2024-04-28T05:31:15Z")

</div>

Presets cannot access (read) any CMake variables, they can only define them.

Also note that presets are evaluated by more than just CMake. They are read and processed by tools, IDEs, etc. It would be unreasonable for presets to rely on information that would require any sort of CMake language parser.
