Skip to content

CMake Error at CMakeLists.txt:22 (add_executable): ... has leading or trailing whitespace. ... policy CMP0004. #3

@ozrien

Description

@ozrien

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions