# How to change clang toolset root directory

**URL:** https://discourse.cmake.org/t/how-to-change-clang-toolset-root-directory/6550
**Category:** Usage
**Tags:** os:windows, gen:vs
**Created:** [September 22, 2022, 10:59am UTC](https://discourse.cmake.org/t/how-to-change-clang-toolset-root-directory/6550 "2022-09-22T10:59:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![serge](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@serge](https://discourse.cmake.org/u/serge)
#### Post date: [September 22, 2022, 10:59am UTC](https://discourse.cmake.org/t/how-to-change-clang-toolset-root-directory/6550/1 "2022-09-22T10:59:35Z")

</div>

Hi everyone,

We are using cmake 3.22 with vs2022 generator and clang toolset: -G “Visual Studio…” -T ClangCL  
In VS there is a way to install clang tools: two check boxes, such that when cmake is invoked it finds automatically the clang binary at: C:\Program…\Microsoft…\2022\VC\Tools\LLVM\bin\clang-cl.exe

But we need a different clang version than the one in VS, how can we achieve that?  
I tried to uninstall the two check boxes of clang installation in VS but then cmake does not find the other  
clang in its default install directory.  
I tried to set CMAKE\_CXX\_COMPILER variable from cmake invocation command (via -D) and it does  
not work neither.

Any suggestion?  
Thanks,  
Serge

---

<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: [September 27, 2022, 7:08pm UTC](https://discourse.cmake.org/t/how-to-change-clang-toolset-root-directory/6550/2 "2022-09-27T19:08:43Z")

</div>

The `-T` flag can support other parameters. I don’t know which `ClangCL` supports, but it might be something like `version=…` or the like. So it’d look like something like `-T ClangCL,version=14`.

---

<div class="post-metadata">

### Author: ![serge](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@serge](https://discourse.cmake.org/u/serge)
#### Post date: [September 29, 2022, 9:11pm UTC](https://discourse.cmake.org/t/how-to-change-clang-toolset-root-directory/6550/3 "2022-09-29T21:11:52Z")

</div>

Thanks Ben for your answer, I’ll check that
