Ignore temporary directories
Fix misprint
Let the script be more general
Relative path for plist location not working for some cmake versions