[CMake] Some questions

E. Wing ewmailing at gmail.com
Fri Apr 4 21:22:13 EDT 2008


> 	-And I don´t know how to use it in a sdl proyect, like in the
> following example:
> 		#include <stdlib.h>
> 		#include "SDL.h"
>
> 		int main(int argc, char *argv[])
> 		{
> 			if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 )
> 			{
> 		        	fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
> 				exit(1);
> 			}
> 			atexit(SDL_Quit);
> 			...
> 		}

For SDL, (typed in mail from memory so it is untested, and ignoring
some of the SDL/OS X quirks about SDLMain.m for clarity),

PROJECT(MySDLProject)
FIND_PACKAGE(SDL)
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
ADD_EXECUTABLE(MySDLProg MACOSX_BUNDLE main.c)
TARGET_LINK_LIBRARIES(MySDLProject ${SDL_LIBRARY})

-Eric


More information about the CMake mailing list