Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Modules/CMakeAddNewLanguage.txt
5009 views
1
This file provides a few notes to CMake developers about how to add
2
support for a new language to CMake. It is also possible to place
3
these files in :variable:`CMAKE_MODULE_PATH` within an outside project
4
to add languages not supported by upstream CMake. However, this is not
5
a fully supported use case.
6
7
The implementation behind the scenes of project/enable_language,
8
including the compiler/platform modules, is an *internal* API that
9
does not make any compatibility guarantees. It is not covered in the
10
official reference documentation that is versioned with the source code.
11
Maintainers of external language support are responsible for porting
12
it to each version of CMake as upstream changes are made. Since
13
the API is internal we will not necessarily include notice of any
14
changes in release notes.
15
16
17
CMakeDetermine(LANG)Compiler.cmake -> this should find the compiler for LANG and configure CMake(LANG)Compiler.cmake.in
18
19
CMake(LANG)Compiler.cmake.in -> used by CMakeDetermine(LANG)Compiler.cmake
20
This file is used to store compiler information and is copied down into try
21
compile directories so that try compiles do not need to re-determine and test the LANG
22
23
CMake(LANG)Information.cmake => set compiler configuration:
24
CMAKE_(LANG)_CREATE_SHARED_LIBRARY
25
CMAKE_(LANG)_CREATE_SHARED_MODULE
26
CMAKE_(LANG)_CREATE_STATIC_LIBRARY
27
CMAKE_(LANG)_COMPILE_OBJECT
28
CMAKE_(LANG)_LINK_EXECUTABLE
29
30
CMAKE_(LANG)_USE_LINKER_INFORMATION
31
32
CMakeTest(LANG)Compiler.cmake -> test the compiler and set:
33
set(CMAKE_(LANG)_COMPILER_WORKS 1 CACHE INTERNAL "")
34
35
36
If the variable CMAKE_(LANG)_USE_LINKER_INFORMATION has value TRUE, the file CMake(LANG)LinkerInformation.cmake
37
should be defined.
38
39
CMake(LANG)LinkerInformation.cmake -> set up linker configuration for LANG.
40
41