clear_variable.cmake 421 B

1234567891011
  1. macro(clear_variable)
  2. cmake_parse_arguments(CLEAR_VAR "" "DESTINATION;BACKUP;REPLACE" "" ${ARGN})
  3. set(${CLEAR_VAR_BACKUP} ${${CLEAR_VAR_DESTINATION}})
  4. set(${CLEAR_VAR_DESTINATION} ${CLEAR_VAR_REPLACE})
  5. endmacro()
  6. macro(restore_variable)
  7. cmake_parse_arguments(CLEAR_VAR "" "DESTINATION;BACKUP" "" ${ARGN})
  8. set(${CLEAR_VAR_DESTINATION} ${${CLEAR_VAR_BACKUP}})
  9. unset(${CLEAR_VAR_BACKUP})
  10. endmacro()