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.