Compilation variant fixes

I think I found two bugs in the compilation variant CMake. But it was a bit hard to grasp the overall concept, so it may be a misunderstanding.