[CMake] Fedora 11 and mingw32

Hendrik Sattler post at hendrik-sattler.de
Mon Jul 6 04:45:16 EDT 2009


Zitat von dulsi at identicalsoftware.com:

> Quoting "Hendrik Sattler" <post at hendrik-sattler.de>:
>
>> Am Sonntag 05 Juli 2009 19:36:44 schrieb dulsi at identicalsoftware.com:
>>> mingw32-SDL is installed.  Looking at the FindSDL.cmake and the
>>> CMAKE_FIND_ROOT_PATH directory I can see why it doesn't find it.  The
>>> /usr/i686-pc-mingw32 directory has bin, lib, and sys-root.  In
>>> sys-root/mingw, you have bin, include, lib, and share.  The FIND_PATH
>>> in FindSDL.cmake is obviously not looking in
>>> sys-root/mingw/include/SDL.  Has anyone used mingw, SDL and cmake on
>>> Fedora?  I don't see how you can configure that to pass.
>>
>> Why should it. You obviously have an incomplete root path in your toolchain
>> file. Please note that CMAKE_FIND_ROOT_PATH is a _list_. In your    
>> case, you must
>> add /usr/i686-pc-mingw32/sys-root/mingw.
>>
>> You may also have to call include_directories() for all standard    
>> include paths
>> in your root paths.
>
> 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




More information about the CMake mailing list