Full error
CMake Error at CMakeLists.txt:22 (add_executable): Target "example" links to item "-L/usr/lib/x86_64-linux-gnu -lSDL2 " which has leading or trailing whitespace. This is now an error according to policy CMP0004.
Fix
If you see this error, one solution is to remove the trailing white space inside sdl2-config.cmake
- sudo vim '/usr/lib/x86_64-linux-gnu/cmake/SDL2/sdl2-config.cmake'
- find "-lSDL2 " at the end of the file and delete trailing space
- write and quit
- (re)run build.sh in Phoenix-Linux-SocketCAN-Example