CMAKE_CURRENT_FUNCTION_LIST_DIRΒΆ

When executing code inside a function(), this variable contains the full directory of the listfile defining the current function.

It is quite common practice in CMake that modules use some additional files (e.g., templates to render). And the code typically did the following:

Using this variable inside a function eliminates the neccessity of the additional one with “global” scope:

Previous topic

CMAKE_CURRENT_FUNCTION

Next topic

CMAKE_CURRENT_FUNCTION_LIST_FILE

This Page