Package: libsdl2-dev Version: 2.0.4+dfsg1-2+b1 Severity: normal Dear Maintainer,
When trying to use SDL2 in a small project with CMake, I encountered the following error: CMake Error at CMakeLists.txt:18 (add_executable): Target "run" 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. This is the relevant part of my own CMakeLists.txt (line 18): ------------------------------ find_package(SDL2 REQUIRED) ------------------------------ The offending line is in /usr/lib/x86_64-linux-gnu/cmake/SDL2/sdl2-config.cmake (could be different depending on the arch used) Line #10: ------------------------------------------------------ set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} -lSDL2 ") ------------------------------------------------------ Removing the trailing whitespace after -lSDL2 fixes the issue for me. (There's also an extra leading whitespace before -lSDL2) I am not certain how to fix this properly in the sdl2-config.cmake.in file, otherwise I would have provided a patch. For the info, the version of CMake I am running: 3.5.1-1 Thanks ! -- System Information: Debian Release: stretch/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.5.2-jpleau (SMP w/8 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages libsdl2-dev depends on: ii libasound2-dev 1.1.0-1 ii libdbus-1-dev 1.10.8-1 ii libegl1-mesa-dev 11.1.3-1 ii libgl1-mesa-dev 11.1.3-1 ii libgles2-mesa-dev 11.1.3-1 ii libglu1-mesa-dev 9.0.0-2.1 ii libpulse-dev 8.0-2+b2 ii libsdl2-2.0-0 2.0.4+dfsg1-2+b1 ii libsndio-dev 1.1.0-2 ii libudev-dev 229-4 ii libwayland-dev 1.10.0-2 ii libx11-dev 2:1.6.3-1 ii libxcursor-dev 1:1.1.14-1+b1 ii libxext-dev 2:1.3.3-1 ii libxi-dev 2:1.7.6-1 ii libxinerama-dev 2:1.1.3-1+b1 ii libxkbcommon-dev 0.5.0-1 ii libxrandr-dev 2:1.5.0-1 ii libxss-dev 1:1.2.2-1 ii libxt-dev 1:1.1.5-1 ii libxv-dev 2:1.0.10-1+b1 ii libxxf86vm-dev 1:1.1.4-1 libsdl2-dev recommends no packages. libsdl2-dev suggests no packages. -- no debconf information