CMakeAddNewLanguage.txt 1.5 KB

12345678910111213141516171819202122232425262728293031
  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. The implementation behind the scenes of project/enable_language,
  7. including the compiler/platform modules, is an *internal* API that
  8. does not make any compatibility guarantees. It is not covered in the
  9. official reference documentation that is versioned with the source code.
  10. Maintainers of external language support are responsible for porting
  11. it to each version of CMake as upstream changes are made. Since
  12. the API is internal we will not necessarily include notice of any
  13. changes in release notes.
  14. CMakeDetermine(LANG)Compiler.cmake -> this should find the compiler for LANG and configure CMake(LANG)Compiler.cmake.in
  15. CMake(LANG)Compiler.cmake.in -> used by CMakeDetermine(LANG)Compiler.cmake
  16. This file is used to store compiler information and is copied down into try
  17. compile directories so that try compiles do not need to re-determine and test the LANG
  18. CMakeTest(LANG)Compiler.cmake -> test the compiler and set:
  19. SET(CMAKE_(LANG)_COMPILER_WORKS 1 CACHE INTERNAL "")
  20. CMake(LANG)Information.cmake -> set up rule variables for LANG :
  21. CMAKE_(LANG)_CREATE_SHARED_LIBRARY
  22. CMAKE_(LANG)_CREATE_SHARED_MODULE
  23. CMAKE_(LANG)_CREATE_STATIC_LIBRARY
  24. CMAKE_(LANG)_COMPILE_OBJECT
  25. CMAKE_(LANG)_LINK_EXECUTABLE