cmake can check for the existence of a file
according to the documentation this should be True if the named file or directory exists. Behavior is well-defined only for full paths., but I found that the said condition fails if the user has neither read not write rights on that file. If I add the permissions, it works.
However, the user that builds the project is not supposed to access the device, so the file permissions are zero for him. The built software will run under a different account with SPI access, so the corresponding module is to be build if the device file is found.
test -e /dev/spidev0.0 is true, but
cmake seems to do
As a workaround, I can check for the symlink in
/sys/class/spidev/spidev0.0, but what's the correct way to handle the problem?