diff options
author | Martin Müllenhaupt <mm@netlair.de> | 2014-10-09 13:49:49 (GMT) |
---|---|---|
committer | Martin Müllenhaupt <mm@netlair.de> | 2014-10-09 13:49:49 (GMT) |
commit | 999ccbd16d6f371e70afc183d97e73f6477d1c10 (patch) | |
tree | 42f5a5ed178ca3a765baec1b09ebe64f763dd5aa /src | |
parent | d9e168678b29cf990866dfbfb35e881929189295 (diff) | |
download | mxe-999ccbd16d6f371e70afc183d97e73f6477d1c10.zip mxe-999ccbd16d6f371e70afc183d97e73f6477d1c10.tar.gz mxe-999ccbd16d6f371e70afc183d97e73f6477d1c10.tar.bz2 |
sdl_sound: provide cmake find-script and test
Diffstat (limited to 'src')
-rw-r--r-- | src/cmake/FindSDL_sound.cmake | 12 | ||||
-rw-r--r-- | src/sdl_sound-test-CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/sdl_sound.mk | 7 |
3 files changed, 29 insertions, 0 deletions
diff --git a/src/cmake/FindSDL_sound.cmake b/src/cmake/FindSDL_sound.cmake new file mode 100644 index 0000000..5de418b --- /dev/null +++ b/src/cmake/FindSDL_sound.cmake @@ -0,0 +1,12 @@ +if(NOT PKG_CONFIG_FOUND) + find_package(PkgConfig REQUIRED) +endif() + +pkg_check_modules(SDL_SOUND SDL_sound) + +#compatiblity +set(SDL_SOUND_VERSION_STRING ${SDL_SOUND_VERSION}) +set(SDL_SOUND_LIBRARIES ${SDL_SOUND_EXTRAS};${SDL_SOUND_LIBRARIES}) + +# for backward compatiblity +set(SDL_SOUND_LIBRARY ${SDL_SOUND_LIBRARIES}) diff --git a/src/sdl_sound-test-CMakeLists.txt b/src/sdl_sound-test-CMakeLists.txt new file mode 100644 index 0000000..4148e23 --- /dev/null +++ b/src/sdl_sound-test-CMakeLists.txt @@ -0,0 +1,10 @@ +project(18) +cmake_minimum_required(VERSION 2.8) + +find_package(SDL_sound REQUIRED) + +include_directories(${SDL_SOUND_INCLUDE_DIRS}) +add_executable(sdl_sound_test + sdl_sound-test.c + ) +target_link_libraries(sdl_sound_test ${SDL_SOUND_LIBRARIES}) diff --git a/src/sdl_sound.mk b/src/sdl_sound.mk index 9705f30..f2ae271 100644 --- a/src/sdl_sound.mk +++ b/src/sdl_sound.mk @@ -57,6 +57,13 @@ define $(PKG)_BUILD -W -Wall -Werror -std=c99 -pedantic \ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-sdl_sound.exe' \ `'$(TARGET)-pkg-config' $(PKG) --cflags --libs` + + mkdir -p '$(1)/cmake-build-test' + cp '$(2)-CMakeLists.txt' '$(1)/cmake-build-test/CMakeLists.txt' + cp '$(2).c' '$(1)/cmake-build-test/' + cd '$(1)/cmake-build-test' && cmake . \ + -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' + $(MAKE) -C '$(1)/cmake-build-test' -j '$(JOBS)' endef $(PKG)_BUILD_SHARED = |