How to override compiler optimisation level?

CMake doesn’t provide an abstraction for optimization flags. Replacing or appending to CMAKE_<LANG>_FLAGS_RELEASE is the best available today.