diff options
author | Timothy Gu <timothygu99@gmail.com> | 2014-10-11 01:07:57 (GMT) |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2014-10-11 01:07:57 (GMT) |
commit | 5d3d306e9c96c768eb8989e190e7de03f31be1e7 (patch) | |
tree | 5c2b06ac0b1cad9cd09949936d19f1dd08da055a /src | |
parent | e8b457a582b4bab60f20efe74ccdf6ede223bbdd (diff) | |
parent | 999ccbd16d6f371e70afc183d97e73f6477d1c10 (diff) | |
download | mxe-5d3d306e9c96c768eb8989e190e7de03f31be1e7.zip mxe-5d3d306e9c96c768eb8989e190e7de03f31be1e7.tar.gz mxe-5d3d306e9c96c768eb8989e190e7de03f31be1e7.tar.bz2 |
Merge pull request #522 from sikoragmbh/add-cmake-SDL_sound
Add cmake FindSDL_sound script
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 | 9 |
3 files changed, 30 insertions, 1 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 201c1c9..f2ae271 100644 --- a/src/sdl_sound.mk +++ b/src/sdl_sound.mk @@ -51,12 +51,19 @@ define $(PKG)_BUILD echo 'Requires: sdl vorbisfile flac speex'; \ echo 'Libs: -lSDL_sound'; \ echo "Libs.private: `'$(PREFIX)/$(TARGET)/bin/libmikmod-config' --libs`";) \ - > '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc' + > '$(PREFIX)/$(TARGET)/lib/pkgconfig/SDL_sound.pc' '$(TARGET)-gcc' \ -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 = |