Bug#950627: Regression: Unable to config with CMake

Brian Clinkenbeard brianclinkenbeard at protonmail.com
Tue Feb 11 01:04:32 GMT 2020


Since SDL2 now comes bundled with sdl2-config.cmake, it seems that using 
an external FindSDL2.cmake is no longer necessary in SDL2 projects using 
CMake. Here is the file I was talking about: 
https://github.com/yuzu-emu/yuzu/blob/master/externals/cmake-modules/FindSDL2.cmake

When I remove this file from the project and allow CMake find the 
libraries with SDL2 with sdl2-config.cmake, CMake runs successfully. So 
while I can't speak for the original reporter, this seems to be an issue 
with projects using a legacy way including SDL2 with CMake and not with 
the package.

On Mon, 10 Feb 2020 20:08:43 +0100 Felix Geyer <fgeyer at debian.org> wrote:
 > On 10.02.20 02:24, Brian Clinkenbeard wrote:
 > > I believe I am also having this issue. "find_package(SDL2 REQUIRED)" in
 > > CMakeLists.txt yields the following error:
 > > -- Target architecture: x86_64
 > > <FindSDL2.cmake>
 > > </FindSDL2.cmake>
 > > CMake Error at
 > > /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146
 > > (message):
 > >   Could NOT find SDL2 (missing: SDL2_INCLUDE_DIR)
 > > Call Stack (most recent call first):
 > > /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393
 > > (_FPHSA_FAILURE_MESSAGE)
 > >   externals/cmake-modules/FindSDL2.cmake:239
 > > (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
 > >   CMakeLists.txt:155 (find_package)
 >
 > Without access to the code (externals/cmake-modules/FindSDL2.cmake in 
this case)
 > I can't really help debug it.
 >
 > My guess is that the custom FindSDL2 module is doing something wrong
 > when it tries to find the SDL2 header files.
 > It doesn't seem to search in all system include paths.
 > The headers have been moved from /usr/include/SDL2 to 
/usr/include/<arch>/SDL2.
 >
 > Cheers,
 > Felix
 >
 >



More information about the Pkg-sdl-maintainers mailing list