0

forexample: in hook, do something and stop this hook

function(EOFHook Variable Access)
  if(${Variable} STREQUAL CMAKE_BACKWARDS_COMPATIBILITY AND
     (${Access} STREQUAL UNKNOWN_READ_ACCESS OR ${Access} STREQUAL READ_ACCESS))
    message("ok")
    ## here stop this watch hook
  endif()
endfunction()

function(SetupEOFHook)
  variable_watch(CMAKE_BACKWARDS_COMPATIBILITY EOFHook)
endfunction()
  • Use https://stackoverflow.com/a/46413179/9072753 to check if the function was altready run , if it was, just `return()`. – KamilCuk Nov 05 '21 at 08:18

0 Answers0