cmake/Help/command/enable_language.rst

25 lines
894 B
ReStructuredText
Raw Normal View History

2014-08-03 19:52:23 +02:00
enable_language
---------------
2022-11-16 20:14:03 +01:00
Enable languages (CXX/C/OBJC/OBJCXX/Fortran/etc)
2014-08-03 19:52:23 +02:00
2019-11-11 23:01:05 +01:00
.. code-block:: cmake
2014-08-03 19:52:23 +02:00
2022-11-16 20:14:03 +01:00
enable_language(<lang>... [OPTIONAL])
2014-08-03 19:52:23 +02:00
2022-11-16 20:14:03 +01:00
Enables support for the named languages in CMake. This is the same as
the :command:`project` command but does not create any of the extra
2023-05-23 16:38:00 +02:00
variables that are created by the project command.
2021-09-14 00:13:48 +02:00
2023-05-23 16:38:00 +02:00
.. include:: SUPPORTED_LANGUAGES.txt
2021-09-14 00:13:48 +02:00
2014-08-03 19:52:23 +02:00
This command must be called in file scope, not in a function call.
Furthermore, it must be called in the highest directory common to all
targets using the named language directly for compiling sources or
indirectly through link dependencies. It is simplest to enable all
needed languages in the top-level directory of a project.
2015-11-17 17:22:37 +01:00
The ``OPTIONAL`` keyword is a placeholder for future implementation and
2018-04-23 21:13:27 +02:00
does not currently work. Instead you can use the :module:`CheckLanguage`
module to verify support before enabling.