sdl not found

hi everyone

i have a problem with linux sdl2 (and i never tried sdl 1.2) usage dont know if it is installation or sth else

cmakelist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
Last edited on
closed account (Dy7SLyTq)
i would just use sfml. i have used both, but sfml gives you much more control imo
┬┐don't you have a package manager to take care of those things?
$ mkdir build && cd build
$ cmake .. \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DSDL_STATIC=OFF \
      -DRPATH=OFF
$ make
$ make install
well sdl 1.2 has an installation but dont have sdl2

and i will use sdl and this is not stubborness
where can i find a good tutorial to install sdl2 ???
closed account (Dy7SLyTq)
www.lazyfoo.com
It is http://lazyfoo.net
you have to go to a slightly different location for sdl2 on lazyfoo it is here: http://lazyfoo.net/tutorials/SDL/index.php

The 1.2 tutorial are at: http://lazyfoo.net/SDL_tutorials/index.php
well i m sad to say that but it seems he didnt included linux installation version yet

and thx for your helps
Last edited on
closed account (Dy7SLyTq)
its easy to install on linux. just build everything
$ 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
Topic archived. No new replies allowed.