Closed LucasChollet closed 4 months ago
The documentation state that this has to be set on the top cmakelists.txt file. Here we are on a toolchain file...
I'm not sure of the side effects of using cmake_minimum_required
after the project call. This does more than checking the version, it changes the policies.
I was thinking that this was the same as when an external library call cmake_minimum_required
after the main project call it for itself. Maybe this is different with a toolchain file... And it's not like we can ask kitware to standardize this eccentric workflow.
I don't have much to say except that it worked during my non-exhaustive testing. Feel free to close the PR if you feel like it.
I agree with you're reasoning, but lets not change things in a way discouraged by the documentation.
cmake_minimum_required
is the recommended way to do this check. Note that this will now make the configuration stop here rather than emiting a warning and panic later, on the line that actually require the version.