Move checks into config/CMakeLists.txt