cmMarkAsAdvancedCommand: ignore variables which don't exist in the cache

Fixes: #18331
15 files changed