cmake_minimum_required(VERSION 2.8)
Project ( test )
set (
SOURCES
main.cpp
)
# REQUIRED does not work in CMake <=2.4.6 for SDL
Find_Package ( SDL REQUIRED )
# Find_Package ( SDL_image REQUIRED ) # if using SDL_image
# Workaround for the non-working REQUIRED flag
if ( NOT SDL_FOUND )
message ( FATAL_ERROR "SDL not found!" )
endif ( NOT SDL_FOUND )
link_libraries (
${SDL_LIBRARY}
# ${SDLIMAGE_LIBRARY} # if using SDL_image, obviously
SDLmain # Sadly not included in SDL_LIBRARY variable
)
add_executable (
test
WIN32 # Only if you don't want the DOS prompt to appear in the background in Windows
MACOSX_BUNDLE
${SOURCES} # We could've listed the source files here directly instead of using a variable to store them
)
FindSDL2.cmake
is at
cmake/modules/
directory
the output
/home/ceset/Projects/test/build> make
make: *** No targets specified and no makefile found. Stop.
*** Failed ***
and if i try konsole at
build/
directory
ceset@Ceset-PC:~/Projects/test/build$ cmake ..
CMake Error at CMakeLists.txt:14 (message):
SDL not found!
what should i do where i m mistaken. also whatever info you need just tell me
$ wget http://www.libsdl.org/release/SDL2-2.0.1.tar.gz
$ tar xvfz SDL2-2.0.1.tar.gz
$ cd SDL2-2.0.1
$ grep -i -A1 linux INSTALL.txt
Linux and other UNIX systems:
* Run './configure; make; make install'
$ ./configure
$ make
# make install