if(DEFINED VAR) -> if(VAR).

If we can't find e.g. dot, the variable DOT_EXECUTABLE will be defined, but it will be set to DOT_EXECUTABLE-NOTFOUND. This value evaluates to false, so we should simply use if(VAR).