SDL, cmake and MinGW

Hi!

How do I get the combination SDL, cmake and MinGW properly set up?
I have a (executable) project on a debian system properly set up using
the following:

Find_Package(SDL REQUIRED)
Find_Package(SDL_image REQUIRED)

if (NOT SDL_FOUND)
message(FATAL_ERROR “SDL not found!”)
endif (NOT SDL_FOUND)

include_directories(include ${SDL_INCLUDE_DIR})
include_directories(include ${SDL_IMAGE_INCLUDE_DIR})

link_libraries(
${SDL_LIBRARY}
${SDLIMAGE_LIBRARY} # if using SDL_image, obviously
SDLmain # Sadly not included in SDL_LIBRARY variable
)

, but havn’t had any luck using the same CMakeLists.txt on windows /
MinGW. On Debian I am using cmake version 2.4-patch5, and on Windows I
have tried both 2.6 and 2.4, but havn’t had any luck making it work.

Could someone guide me through a proper installation of SDL to make
CMake find it? (I have tried both with “pure” MinGW and MSys.)

/Andreas