Fixed compile flags handling when using cmake release flags and the precompiled header option.

This fixed the Mageia packaging and will probably fix others as well.