Mac fixes

Tested on mac. Fixed post build event and made it cross-platform