[CMake] Find SDL

Benjamin Eikel cmake at eikel.org
Sun Aug 31 16:15:37 EDT 2014


Hi Christer,

Zitat von Christer Solskogen <christer.solskogen at gmail.com>:
> They are cross compiled for Windows (mingw-w64) which means that they have
> different names (libSDL.dll.a for instance) but they are installed in
> /opt/cross-mingw-w64/x86_64-w64-mingw32/{include,lib}.
>
> x86_64-w64-mingw32-gcc is using /home/solskogen/obj/cross-mingw-w64 as
> sysroot.
> cmake have no trouble finding png or zlib.
> -- Found ZLIB: /opt/cross-mingw-w64/x86_64-w64-mingw32/lib/libz.a (found
> version "1.2.8")
> -- Found PNG: /opt/cross-mingw-w64/x86_64-w64-mingw32/lib/libpng.a (found
> version "1.6.12")
>

I have created a small test [1] that downloads and builds SDL2,  
installs it, and builds a little test program using SDL2. For  
cross-compiling, I am using the mingw-w64 [2] compilers provided in  
Debian GNU/Linux. I use the FindSDL2 module that I posted to this  
mailing list some time ago [3, 4]. This module has no problem finding  
the SDL2 installation:
-- Found SDL2: [… snip …]/cmake-FindSDL-test/install/include/SDL2  
(found suitable version "2.0.3", minimum required is "2.0.3")
Have you also installed SDL2, or did you try to find the build directory?

Kind regards
Benjamin

[1] https://github.com/eikel/CMake-FindSDL-Test
[2] https://packages.debian.org/sid/mingw-w64
[3] http://www.cmake.org/pipermail/cmake/2013-August/055518.html
[4] https://github.com/PADrend/Util/blob/master/cmake/FindSDL2.cmake





More information about the CMake mailing list