Moved compiler problem detection into separate module

This makes the main CMakeLists.txt slightly more readable.

Change-Id: Ibbae29ef89578587a4d103b5176b7bf0eda2d82b