# DEPRECATION "The CMAKE\_FORCE\_C\_COMPILER " clarification

**URL:** https://discourse.cmake.org/t/deprecation-the-cmake-force-c-compiler-clarification/2814
**Category:** Code
**Tags:** os:windows, gen:makefiles
**Created:** [February 23, 2021, 7:35am UTC](https://discourse.cmake.org/t/deprecation-the-cmake-force-c-compiler-clarification/2814 "2021-02-23T07:35:13Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [February 23, 2021, 6:59pm UTC](https://discourse.cmake.org/t/deprecation-the-cmake-force-c-compiler-clarification/2814/2 "2021-02-23T18:59:07Z")

</div>

You should use [a toolchain file](https://cmake.org/cmake/help/v3.6/manual/cmake-toolchains.7.html) or pass `-DCMAKE_${LANG}_COMPILER=$path` on the command line. Projects should not set `CMAKE_${LANG}_COMPILER}` themselves.

[This Discourse thread](https://discourse.cmake.org/t/proper-way-to-set-compiler-and-language-standard-in-cmake/2756) is related.

---

_[View the full topic](https://discourse.cmake.org/t/deprecation-the-cmake-force-c-compiler-clarification/2814)._
