cmake: Do not open directories as scripts (#14966)

Check if a file path is a directory before opening it.  Extend the
RunCMake.CommandLine test with a case running "cmake -P" on a directory.
Merge topic 'no-parse-directory' into next

b1c113d9 cmake: Do not open directories as scripts (#14966)
Merge topic 'FindOpenGL-target'

4883813f Help: Add notes for topic 'FindOpenGL-target'
Merge branch 'master' into next