Files
CMake/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION-stdout.txt
Alex Turbov 90e3e2a777 cmFunctionCommand: Introduce CMAKE_CURRENT_FUNCTION* variables
`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.

...
2019-12-10 16:43:27 +02:00

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\(\)