9db3116226
Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
32 lines
666 B
CMake
32 lines
666 B
CMake
message("Start")
|
|
|
|
variable_watch(TESTVAR MESSAGE)
|
|
variable_watch(TESTVAR1)
|
|
|
|
macro(testwatch var access file stack)
|
|
message("There was a ${access} access done on the variable: ${var} in file ${file}")
|
|
message("List file stack is: ${stack}")
|
|
set(${var}_watched 1)
|
|
endmacro()
|
|
|
|
variable_watch(somevar testwatch)
|
|
|
|
set(TESTVAR1 "1")
|
|
set(TESTVAR "1")
|
|
set(TESTVAR1 "0")
|
|
set(TESTVAR "0")
|
|
|
|
|
|
message("Variable: ${somevar}")
|
|
if(NOT somevar_watched)
|
|
message(SEND_ERROR "'somevar' watch failed!")
|
|
endif()
|
|
set(somevar_watched)
|
|
|
|
set(somevar "1")
|
|
message("Variable: ${somevar}")
|
|
if(NOT somevar_watched)
|
|
message(SEND_ERROR "'somevar' watch failed!")
|
|
endif()
|
|
remove(somevar)
|