Fixed some portability issues in CMakeList.txt.

Some linux specific settings were being applied to the Windows build.