[CMake] Fedora 11 and mingw32

Alexander Neundorf a.neundorf-work at gmx.net
Tue Jul 7 13:14:43 EDT 2009


On Tuesday 07 July 2009, dulsi at identicalsoftware.com wrote:
> Quoting "Hendrik Sattler" <post at hendrik-sattler.de>:
> > Zitat von dulsi at identicalsoftware.com:
> >> Adding /usr/i686-pc-mingw32/sys-root/mingw isn't going to accomplish
> >> anything as /include is not in the list that FindSDL.cmake is looking
> >> at.  It is looking for /usr/include.  I tried it anyway and it still
> >> doesn't find SDL.  I could modify FindSDL.cmake to make it work but my
> >> goal is to make the program compile on a standard fedora system.
> >
> > I cite myself: "You may also have to call include_directories() for all
> > standard include paths in your root paths."
> > This may include adding the your include/SDL.
> >
> > I admit that FindSDL is not using the latest technique of PATH_SUFFIXES
> > the right way (should be include include/SDL include/SDL11
> > include/SDL12, and the PATHS list below should be much smaller then).
> > Nevertheless, doing it right in the toolchain file will probably make
> > it work.
> > You can also set the variable ENV{SDLDIR} in your toolchain file if you
> > find that easier:
> > set ( ENV{SDLDIR} /my/path/to/include/SDL )
> >
> > HS
>
> While I could do that, it defeats the purpose of the mingw32
> cross-compiler.  The point is to allow you to cross-compile for
> windows without needing any changes to your project.  I've filed a bug
> with fedora to see if it can be fixed.

Not all Find-modules shipped with cmake are probably cross-compile ready, 
FindSDL.cmake may be one of them.

So I guess a patch against FindSDL.cmake which
1) keeps compatibility
and 2) makes good use of PATH_SUFFIXES so that CMAKE_PREFIX_PATH works if set 
to  /usr/i686-pc-mingw32/sys-root/mingw
would be a good thing.

Alex


More information about the CMake mailing list