summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2015-10-03 06:33:41 (GMT)
committerTony Theodore <tonyt@logyst.com>2015-10-03 06:33:41 (GMT)
commit1dd126b160ef3ec80fee9b2c5d0563486815cbe6 (patch)
treeb641ad6d1edc2ef9a848c2e7b21108952abacfc3
parentecfd032fc65f6e6be1cbe36691a5e8b055ea925c (diff)
downloadmxe-1dd126b160ef3ec80fee9b2c5d0563486815cbe6.zip
mxe-1dd126b160ef3ec80fee9b2c5d0563486815cbe6.tar.gz
mxe-1dd126b160ef3ec80fee9b2c5d0563486815cbe6.tar.bz2
sdl: add cmake test
-rw-r--r--src/sdl.mk14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sdl.mk b/src/sdl.mk
index f0c85c0..aee5fb6 100644
--- a/src/sdl.mk
+++ b/src/sdl.mk
@@ -33,4 +33,18 @@ define $(PKG)_BUILD
-W -Wall -Werror -ansi -pedantic \
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-sdl.exe' \
`'$(TARGET)-pkg-config' sdl --cflags --libs`
+
+ # test cmake
+ mkdir '$(1).test-cmake'
+ (echo 'cmake_minimum_required(VERSION 2.8.11)'; \
+ echo 'project(test-$(PKG)-cmake)'; \
+ echo 'find_package(SDL REQUIRED)'; \
+ echo 'include_directories($${SDL_INCLUDE_DIRS})'; \
+ echo 'add_executable(test-$(PKG)-cmake $(PREFIX)/../src/$(PKG)-test.c)'; \
+ echo 'target_link_libraries(test-$(PKG)-cmake $${SDL_LIBRARIES})'; \
+ echo 'install(TARGETS test-$(PKG)-cmake DESTINATION bin)'; \
+ ) > '$(1).test-cmake/CMakeLists.txt'
+
+ cd '$(1).test-cmake' && '$(TARGET)-cmake' .
+ $(MAKE) -C '$(1).test-cmake' -j 1 install
endef