Starting with CLion 2017.3, go to Settings/Preferences | Build, Execution, Deployment | Toolchains , select the toolchain you'd like to configure (you can use several at a time), change C/C++ compilers path there.
As an alternative or for older CLion versions:
Since CLion relies on CMake build system. To change the compiler used in CLion, use method #2 from the official CMake documentation.
Go to Preferences/Settings | Build, Execution, Deployment | CMake | CMake options and pass the following commands:
The corresponding CMake cache variables will be overwritten.
Also find more details and samples in our Quick CMake Tutorial.