Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Help / variable / CMAKE_LANG_COMPILER.rst
1 CMAKE_<LANG>_COMPILER
2 ---------------------
3
4 The full path to the compiler for ``LANG``.
5
6 This is the command that will be used as the ``<LANG>`` compiler.  Once
7 set, you can not change this variable.
8
9 Usage
10 ^^^^^
11
12 This variable can be set by the user during the first time a build tree is configured.
13
14 If a non-full path value is supplied then CMake will resolve the full path of
15 the compiler.
16
17 The variable could be set in a user supplied toolchain file or via
18 :option:`-D <cmake -D>` on the command line.
19
20 .. note::
21   Options that are required to make the compiler work correctly can be included
22   as items in a list; they can not be changed.
23
24 .. code-block:: cmake
25
26   #set within user supplied toolchain file
27   set(CMAKE_C_COMPILER /full/path/to/qcc --arg1 --arg2)
28
29 or
30
31 .. code-block:: console
32
33   $ cmake ... -DCMAKE_C_COMPILER='qcc;--arg1;--arg2'