proposed CMake modifications

In response to some recent discussion on the mailing list as well as IRC. I've tested this on Windows and OSX. Details provided in commit message.