mkleemann / cmake-avr

cmake toolchain for AVR
Other
174 stars 61 forks source link

Add REQUIRED to the avr-gcc, avr-g++, executables #22

Closed AE1020 closed 3 years ago

AE1020 commented 3 years ago

This is a suggestion of getting clearer messages at the moment that the files can't be found. This helps in particular to show where the lack of finding is happening, so people can check their path.

AE1020 commented 3 years ago

I suggest this because I tried to build on Windows, and had to go digging when it wasn't finding avr-gcc to see what was going wrong.

It turned out that the PATH element for avr-gcc had been done with forward slashes, which works in bash on Windows but CMake doesn't recognize that when examining the PATH itself for find_program().

Having found the issue, I thought it would be good to give a more informative error message at the moment of find_program()...because that's where I ultimately needed to focus. But it turned out there was a REQUIRED option, which seemed like it might be good to use?

It seems that someone could pretty easily be guided to delete the REQUIRED if they had half a toolchain for some reason...