Fix wrong compiler version detection (occurs when ccache is detected as the compiler).
When ccache is installed and enabled, ccache is detected as the compiler. Current code detects the compiler version incorrectly by parsing the output of 'ccache --version'. The fix, which worked in my case, is to reuse CMAKE_C_COMPILER_VERSION if already defined.