From 1dd126b160ef3ec80fee9b2c5d0563486815cbe6 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Sat, 3 Oct 2015 16:33:41 +1000 Subject: sdl: add cmake test --- src/sdl.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- cgit v0.12