[CMake] Fedora 11 and mingw32

Alexander Neundorf a.neundorf-work at gmx.net
Sun Jul 5 12:07:40 EDT 2009


On Sunday 05 July 2009, dulsi at identicalsoftware.com wrote:
> I've started playing with cmake so that I can easily use the mingw32
> under Fedora 11 to cross-compile programs.  I've compiled a simple
> hello world program fine.  I added SDL to the hello world program and
> modified the CMakeLists.txt to:
>
> Find_Package(SDL REQUIRED)
>
> if (NOT SDL_FOUND)
>   message(FATAL_ERROR "SDL not found!")
> endif (NOT SDL_FOUND)
>
> include_directories(include ${SDL_INCLUDE_DIR})
>
> link_libraries(
>    ${SDL_LIBRARY}
> )
> add_executable(hello hello.cpp)
>
> Compiling for linux works fine.  Compiling for mingw32 with the
> toolchain file from http://www.cmake.org/Wiki/CmakeMingw returns the
> following error:
>
> CMake Error at CMakeLists.txt:4 (message):
>    SDL not found!
>
> How can I compile an SDL program with mingw32 cross-compiler?

Is SDL for Windows installed ?
What's the exact problem, i.e. why is it not found ?
You have to take a look at FindSDL.cmake and figure out what's going wrong.

Alex


More information about the CMake mailing list