cmake_minimum_required/project: Warn if called in wrong order
Calling cmake_minimum_required()
after project()
is likely a user error. I believe that CMake should emit a warning for this by default. The consequence of this is that project()
and the CMake files it invokes, like the user provided toolchain file, do not have any policies set. Policies are only set after the cmake_minimum_required()
call.
I believe that cmake_minimum_required()
(almost always) immediately followed by project()
ought to be the "shebang" of CMakeLists.txt files.