ObKo / stm32-cmake

CMake for stm32 developing.
MIT License
1.2k stars 340 forks source link

Replace an had oc check for CMake's version with a builtin #347

Closed LucasChollet closed 4 months ago

LucasChollet commented 5 months ago

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.

Hish15 commented 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.

LucasChollet commented 4 months ago

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.

Hish15 commented 4 months ago

I agree with you're reasoning, but lets not change things in a way discouraged by the documentation.