Variables with angle brackets in CMake scripts

I noticed that CMake can use variables not only in the syntax ${VAR_NAME} , but also in the syntax <VAR_NAME> . For example, the following code:

 IF(NOT CMAKE_CXX_LINK_EXECUTABLE) SET(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE) 

was found in the CMake modules folder in a script named CMakeCXXInformation.cmake .

I did not find syntax explanations using angle brackets in the documentation. Has anyone used a syntax that can explain its meaning?

+4
source share
1 answer

This syntax is specific for defining compilation and linking rules. It is used by the internal CMake engine and is not intended for use by CMake users.

These rules come into play when adding support for a new language in CMake, see share/cmake/Modules/CMakeAddNewLanguage.txt for more information on this.

+2
source

Source: https://habr.com/ru/post/1446428/


All Articles