Modified CMake file to work on Mac and Windows