How to detect misspelled variable names on command line

My CMakeLists.txt can take variables and values specified on the command line in the usual form -Dname=value. E.g.

% cmake -DmyVariable=someValue ..

How can CMakeLists.txt detect variables that aren’t actually relevant, e.g. in case the user mispells them:

% cmake -Dmyxvarble=someValue ..

For example, can CMakeLists.txt process each defined variable on the command line sequentially, thereby spotting misspelled variable names?

I’m running cmake version 3.18.0-rc2

CMake already warns when a variable set on the command line is not subsequently used by the program. Cache entries also get rendered in the ccmake and cmake-gui interfaces, which make spelling a name wrong impossible.

CMake also allows you to dereference unset variables and specifies the semantics: you get an empty string. So what it would mean for a variable to be “misspelled” in the first place is unclear.