# How do I set up a CMAKE\_TOOLCHAIN\_FILE toolchain file

**URL:** https://discourse.cmake.org/t/how-do-i-set-up-a-cmake-toolchain-file-toolchain-file/4150
**Category:** Usage
**Created:** [September 27, 2021, 2:34pm UTC](https://discourse.cmake.org/t/how-do-i-set-up-a-cmake-toolchain-file-toolchain-file/4150 "2021-09-27T14:34:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![boxerab](https://discourse.cmake.org/user_avatar/discourse.cmake.org/boxerab/32/718_2.png) [@boxerab](https://discourse.cmake.org/u/boxerab)
#### Post date: [September 27, 2021, 2:34pm UTC](https://discourse.cmake.org/t/how-do-i-set-up-a-cmake-toolchain-file-toolchain-file/4150/1 "2021-09-27T14:34:48Z")

</div>

I am cross-compiling on x86 for aarch64 target.

I use ${CMAKE\_HOST\_SYSTEM\_PROCESSOR} currently to detect the host processor,  
and set variables accordingly, but I would like instead to use the target processor  
in my CMakeLists.txt file.
