summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2018-06-28 01:41:47 +0300
committerTuomas Virtanen <katajakasa@gmail.com>2018-06-28 01:41:47 +0300
commit6c378b43d2c61884842bf2b399461d5e0460c3ef (patch)
tree46f6a8e0735e22441f752f582973149736d5cded
parent5a63ff2db3dd3f1dbc37fe8e28c03b31f2a08b2f (diff)
Include SDL2 libraries properly
-rw-r--r--CMakeLists.txt4
-rw-r--r--README.md2
-rw-r--r--cmake/FindSDL2.cmake54
-rw-r--r--cmake/Findcunit.cmake41
-rw-r--r--examples/example_audio.c2
-rw-r--r--examples/example_complex.c2
-rw-r--r--examples/example_custom.c2
-rw-r--r--examples/example_simple.c2
-rw-r--r--include/kitchensink/internal/kitdecoder.h2
-rw-r--r--include/kitchensink/internal/subtitle/kitatlas.h5
-rw-r--r--include/kitchensink/internal/subtitle/kitsubtitle.h2
-rw-r--r--include/kitchensink/internal/subtitle/kitsubtitlepacket.h2
-rw-r--r--include/kitchensink/internal/video/kitvideo.h2
-rw-r--r--include/kitchensink/kitplayer.h2
-rw-r--r--src/internal/audio/kitaudio.c2
-rw-r--r--src/internal/libass.c2
-rw-r--r--src/internal/subtitle/kitsubtitle.c2
-rw-r--r--src/internal/subtitle/renderers/kitsubass.c2
-rw-r--r--src/internal/subtitle/renderers/kitsubimage.c2
-rw-r--r--src/kitlib.c2
-rw-r--r--src/kitplayer.c2
-rw-r--r--src/kitutils.c2
22 files changed, 22 insertions, 118 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b6a0646..2fbfdb3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.7)
project(SDL_kitchensink C)
include(GNUInstallDirs)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
@@ -23,7 +23,7 @@ option(BUILD_EXAMPLES "Build examples" OFF)
option(USE_DYNAMIC_LIBASS "Use dynamically loaded libass" ON)
option(USE_ASAN "Use AddressSanitizer" OFF)
-find_package(SDL2)
+find_package(SDL2 REQUIRED)
find_package(ffmpeg COMPONENTS avcodec avformat avutil swscale swresample)
set(LIBRARIES
diff --git a/README.md b/README.md
index 8a601b0..db45b8b 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
FFmpeg and SDL2 based library for audio and video playback, written in C99.
-Documentation is available at http://katajakasa.github.io/SDL_kitchensink/index.html
+Documentation is available at http://katajakasa.github.io/SDL_kitchensink/
Features:
* Decoding video, audio and subtitles via FFmpeg
diff --git a/cmake/FindSDL2.cmake b/cmake/FindSDL2.cmake
deleted file mode 100644
index 8102832..0000000
--- a/cmake/FindSDL2.cmake
+++ /dev/null
@@ -1,54 +0,0 @@
-# A Simple SDL2 Finder.
-# (c) Tuomas Virtanen 2016 (Licensed under MIT license)
-# Usage:
-# find_package(SDL2)
-#
-# Declares:
-# * SDL2_FOUND
-# * SDL2_INCLUDE_DIRS
-# * SDL2_LIBRARIES
-#
-
-set(SDL2_SEARCH_PATHS
- /usr/local/
- /usr/
- /opt
-)
-
-find_path(SDL2_INCLUDE_DIR SDL2/SDL.h
- HINTS
- PATH_SUFFIXES include
- PATHS ${SDL2_SEARCH_PATHS}
-)
-
-find_library(SDL2_LIBRARY
- NAMES SDL2
- HINTS
- PATH_SUFFIXES lib
- PATHS ${SDL2_SEARCH_PATHS}
-)
-
-if(MINGW)
- find_library(SDL2MAIN_LIBRARY
- NAMES SDL2main
- HINTS
- PATH_SUFFIXES lib
- PATHS ${SDL2_SEARCH_PATHS}
- )
-else()
- set(SDL2MAIN_LIBRARY "")
-endif()
-
-if(SDL2_INCLUDE_DIR AND SDL2_LIBRARY)
- set(SDL2_FOUND TRUE)
-endif()
-
-if(SDL2_FOUND)
- set(SDL2_LIBRARIES ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY})
- set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
- message(STATUS "Found SDL2: ${SDL2_LIBRARIES}")
-else()
- message(WARNING "Could not find SDL2")
-endif()
-
-mark_as_advanced(SDL2MAIN_LIBRARY SDL2_LIBRARY SDL2_INCLUDE_DIR SDL2_SEARCH_PATHS)
diff --git a/cmake/Findcunit.cmake b/cmake/Findcunit.cmake
deleted file mode 100644
index ae81cf1..0000000
--- a/cmake/Findcunit.cmake
+++ /dev/null
@@ -1,41 +0,0 @@
-# A Simple CUnit Finder.
-# (c) Tuomas Virtanen 2016 (Licensed under MIT license)
-# Usage:
-# find_package(cunit)
-#
-# Declares:
-# * CUNIT_FOUND
-# * CUNIT_INCLUDE_DIRS
-# * CUNIT_LIBRARIES
-#
-
-set(CUNIT_SEARCH_PATHS
- /usr/local/
- /usr
- /opt
-)
-
-find_path(CUNIT_INCLUDE_DIR CUnit/CUnit.h
- HINTS
- PATH_SUFFIXES include
- PATHS ${CUNIT_SEARCH_PATHS}
-)
-find_library(CUNIT_LIBRARY cunit
- HINTS
- PATH_SUFFIXES lib
- PATHS ${CUNIT_SEARCH_PATHS}
-)
-
-if(CUNIT_INCLUDE_DIR AND CUNIT_LIBRARY)
- set(CUNIT_FOUND TRUE)
-endif()
-
-if(CUNIT_FOUND)
- set(CUNIT_LIBRARIES ${CUNIT_LIBRARY})
- set(CUNIT_INCLUDE_DIRS ${CUNIT_INCLUDE_DIR})
- message(STATUS "Found CUnit: ${CUNIT_LIBRARY}")
-else()
- message(WARNING "Could not find CUnit.")
-endif()
-
-mark_as_advanced(CUNIT_LIBRARY CUNIT_INCLUDE_DIR)
diff --git a/examples/example_audio.c b/examples/example_audio.c
index 80c8dab..20c8cdf 100644
--- a/examples/example_audio.c
+++ b/examples/example_audio.c
@@ -1,5 +1,5 @@
#include <kitchensink/kitchensink.h>
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include <stdio.h>
#include <stdbool.h>
diff --git a/examples/example_complex.c b/examples/example_complex.c
index ada613a..5bd0b19 100644
--- a/examples/example_complex.c
+++ b/examples/example_complex.c
@@ -1,5 +1,5 @@
#include <kitchensink/kitchensink.h>
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include <stdio.h>
#include <stdbool.h>
diff --git a/examples/example_custom.c b/examples/example_custom.c
index 1d33b0e..43ae40a 100644
--- a/examples/example_custom.c
+++ b/examples/example_custom.c
@@ -1,5 +1,5 @@
#include <kitchensink/kitchensink.h>
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include <stdio.h>
#include <stdbool.h>
diff --git a/examples/example_simple.c b/examples/example_simple.c
index 2569fab..a7dbbfd 100644
--- a/examples/example_simple.c
+++ b/examples/example_simple.c
@@ -1,5 +1,5 @@
#include <kitchensink/kitchensink.h>
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include <stdio.h>
#include <stdbool.h>
diff --git a/include/kitchensink/internal/kitdecoder.h b/include/kitchensink/internal/kitdecoder.h
index 0e89aea..1bddda5 100644
--- a/include/kitchensink/internal/kitdecoder.h
+++ b/include/kitchensink/internal/kitdecoder.h
@@ -3,7 +3,7 @@
#include <stdbool.h>
-#include <SDL2/SDL_mutex.h>
+#include <SDL_mutex.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
diff --git a/include/kitchensink/internal/subtitle/kitatlas.h b/include/kitchensink/internal/subtitle/kitatlas.h
index 7701966..c901259 100644
--- a/include/kitchensink/internal/subtitle/kitatlas.h
+++ b/include/kitchensink/internal/subtitle/kitatlas.h
@@ -2,9 +2,8 @@
#define KITATLAS_H
#include <stdbool.h>
-#include <SDL2/SDL_rect.h>
-#include <SDL2/SDL_surface.h>
-#include <SDL2/SDL_render.h>
+#include <SDL_rect.h>
+#include <SDL_render.h>
#include "kitchensink/kitconfig.h"
diff --git a/include/kitchensink/internal/subtitle/kitsubtitle.h b/include/kitchensink/internal/subtitle/kitsubtitle.h
index 8de101b..7ea6fbd 100644
--- a/include/kitchensink/internal/subtitle/kitsubtitle.h
+++ b/include/kitchensink/internal/subtitle/kitsubtitle.h
@@ -1,7 +1,7 @@
#ifndef KITSUBTITLE_H
#define KITSUBTITLE_H
-#include <SDL2/SDL_render.h>
+#include <SDL_render.h>
#include "kitchensink/kitconfig.h"
#include "kitchensink/kitsource.h"
diff --git a/include/kitchensink/internal/subtitle/kitsubtitlepacket.h b/include/kitchensink/internal/subtitle/kitsubtitlepacket.h
index 0c97e00..c560c74 100644
--- a/include/kitchensink/internal/subtitle/kitsubtitlepacket.h
+++ b/include/kitchensink/internal/subtitle/kitsubtitlepacket.h
@@ -2,7 +2,7 @@
#define KITSUBTITLEPACKET_H
#include <stdbool.h>
-#include <SDL2/SDL_surface.h>
+#include <SDL_surface.h>
#include "kitchensink/kitconfig.h"
diff --git a/include/kitchensink/internal/video/kitvideo.h b/include/kitchensink/internal/video/kitvideo.h
index 0733177..5c072ef 100644
--- a/include/kitchensink/internal/video/kitvideo.h
+++ b/include/kitchensink/internal/video/kitvideo.h
@@ -1,7 +1,7 @@
#ifndef KITVIDEO_H
#define KITVIDEO_H
-#include <SDL2/SDL_render.h>
+#include <SDL_render.h>
#include "kitchensink/kitconfig.h"
#include "kitchensink/kitsource.h"
diff --git a/include/kitchensink/kitplayer.h b/include/kitchensink/kitplayer.h
index 791851f..1c73020 100644
--- a/include/kitchensink/kitplayer.h
+++ b/include/kitchensink/kitplayer.h
@@ -14,7 +14,7 @@
#include "kitchensink/kitformat.h"
#include "kitchensink/kitcodec.h"
-#include <SDL2/SDL_render.h>
+#include <SDL_render.h>
#ifdef __cplusplus
extern "C" {
diff --git a/src/internal/audio/kitaudio.c b/src/internal/audio/kitaudio.c
index 8cf2d3e..02b9787 100644
--- a/src/internal/audio/kitaudio.c
+++ b/src/internal/audio/kitaudio.c
@@ -5,7 +5,7 @@
#include <libavformat/avformat.h>
#include <libavutil/samplefmt.h>
#include <libswresample/swresample.h>
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include "kitchensink/kiterror.h"
#include "kitchensink/internal/kitlibstate.h"
diff --git a/src/internal/libass.c b/src/internal/libass.c
index da0c862..4a43e86 100644
--- a/src/internal/libass.c
+++ b/src/internal/libass.c
@@ -1,6 +1,6 @@
#ifdef USE_DYNAMIC_LIBASS
-#include <SDL2/SDL_loadso.h>
+#include <SDL_loadso.h>
#include "kitchensink/internal/libass.h"
int load_libass(void *handle) {
diff --git a/src/internal/subtitle/kitsubtitle.c b/src/internal/subtitle/kitsubtitle.c
index 9fcf95c..3617ec7 100644
--- a/src/internal/subtitle/kitsubtitle.c
+++ b/src/internal/subtitle/kitsubtitle.c
@@ -1,6 +1,6 @@
#include <assert.h>
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include <libavformat/avformat.h>
#include "kitchensink/internal/utils/kitlog.h"
diff --git a/src/internal/subtitle/renderers/kitsubass.c b/src/internal/subtitle/renderers/kitsubass.c
index 06fc2e8..322e396 100644
--- a/src/internal/subtitle/renderers/kitsubass.c
+++ b/src/internal/subtitle/renderers/kitsubass.c
@@ -1,7 +1,7 @@
#include <assert.h>
#include <stdlib.h>
-#include <SDL2/SDL_surface.h>
+#include <SDL_surface.h>
#include "kitchensink/kiterror.h"
#include "kitchensink/internal/utils/kitlog.h"
diff --git a/src/internal/subtitle/renderers/kitsubimage.c b/src/internal/subtitle/renderers/kitsubimage.c
index a6e8393..890a829 100644
--- a/src/internal/subtitle/renderers/kitsubimage.c
+++ b/src/internal/subtitle/renderers/kitsubimage.c
@@ -1,7 +1,7 @@
#include <assert.h>
#include <stdlib.h>
-#include <SDL2/SDL_surface.h>
+#include <SDL_surface.h>
#include "kitchensink/kiterror.h"
#include "kitchensink/internal/utils/kitlog.h"
diff --git a/src/kitlib.c b/src/kitlib.c
index 9011ea3..9cfd13e 100644
--- a/src/kitlib.c
+++ b/src/kitlib.c
@@ -1,5 +1,5 @@
#include <assert.h>
-#include <SDL2/SDL_loadso.h>
+#include <SDL_loadso.h>
#include <libavformat/avformat.h>
diff --git a/src/kitplayer.c b/src/kitplayer.c
index 16cdb1d..c2b62d3 100644
--- a/src/kitplayer.c
+++ b/src/kitplayer.c
@@ -1,6 +1,6 @@
#include <assert.h>
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include "kitchensink/kitplayer.h"
#include "kitchensink/kiterror.h"
diff --git a/src/kitutils.c b/src/kitutils.c
index 1c62ddc..8cf7261 100644
--- a/src/kitutils.c
+++ b/src/kitutils.c
@@ -1,4 +1,4 @@
-#include <SDL2/SDL.h>
+#include <SDL.h>
#include "kitchensink/kitutils.h"
#include "kitchensink/kitsource.h"