mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
`CMAKE_CURRENT_FUNCTION` Can be used for diagnostic or debugging messages like the `__PRETTY_FUNCTION__` macro of GCC. `CMAKE_CURRENT_FUNCTION_LIST_DIR` Eliminates the necessity of the additional "global" variables inside a module used to access additional "resource" files from functions defined in the module. ...
8 lines
375 B
Plaintext
8 lines
375 B
Plaintext
function\(print_self\)
|
|
file\(STRINGS "\${CMAKE_CURRENT_FUNCTION_LIST_FILE}" _lines\)
|
|
math\(EXPR _begin "\${CMAKE_CURRENT_FUNCTION_LIST_LINE} - 1"\)
|
|
list\(SUBLIST _lines \${_begin} 7 _lines\) # This function has 7 lines only
|
|
list\(JOIN _lines "\\n" _lines\)
|
|
message\(STATUS "Print the `\${CMAKE_CURRENT_FUNCTION}` function:\\n\${_lines}"\)
|
|
endfunction\(\)
|