variable_watch

Watch the CMake variable for change.

variable_watch(<variable> [<command>])

If the specified <variable> changes, a message will be printed to inform about the change.

Additionally, if <command> is given, this command will be executed. The command will receive the following arguments: COMMAND(<variable> <access> <value> <current_list_file> <stack>)

© 2000–2020 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/v3.17/command/variable_watch.html