rearrange CMakeLists.txt lines to give more logical errors