2012-08-13 21:47:32 +04:00
|
|
|
message("Start")
|
2007-04-11 23:13:05 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
variable_watch(TESTVAR MESSAGE)
|
|
|
|
variable_watch(TESTVAR1)
|
2007-04-11 23:13:05 +04:00
|
|
|
|
|
|
|
macro(testwatch var access file stack)
|
2012-08-13 21:47:32 +04:00
|
|
|
message("There was a ${access} access done on the variable: ${var} in file ${file}")
|
|
|
|
message("List file stack is: ${stack}")
|
2009-07-25 00:57:38 +04:00
|
|
|
set(${var}_watched 1)
|
2012-08-13 21:50:14 +04:00
|
|
|
endmacro()
|
2007-04-11 23:13:05 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
variable_watch(somevar testwatch)
|
2007-04-11 23:13:05 +04:00
|
|
|
|
|
|
|
set(TESTVAR1 "1")
|
|
|
|
set(TESTVAR "1")
|
|
|
|
set(TESTVAR1 "0")
|
|
|
|
set(TESTVAR "0")
|
|
|
|
|
|
|
|
|
|
|
|
message("Variable: ${somevar}")
|
2009-07-25 00:57:38 +04:00
|
|
|
if(NOT somevar_watched)
|
|
|
|
message(SEND_ERROR "'somevar' watch failed!")
|
|
|
|
endif()
|
|
|
|
set(somevar_watched)
|
|
|
|
|
2007-04-11 23:13:05 +04:00
|
|
|
set(somevar "1")
|
|
|
|
message("Variable: ${somevar}")
|
2009-07-25 00:57:38 +04:00
|
|
|
if(NOT somevar_watched)
|
|
|
|
message(SEND_ERROR "'somevar' watch failed!")
|
|
|
|
endif()
|
2007-04-11 23:13:05 +04:00
|
|
|
remove(somevar)
|