That is one of those CMake gotchas that you really have to watch out for. It burns me every time I'm starting a new CMake project and am still playing around with settings.