1 cmake_minimum_required(VERSION 2.6)
2 project(test-shapes-gles1)
6 pkg_check_modules(freeglut REQUIRED freeglut-gles1>=3.0.0)
8 include_directories(${freeglut_STATIC_INCLUDE_DIRS})
9 link_directories(${freeglut_STATIC_LIBRARY_DIRS})
10 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${freeglut_STATIC_CFLAGS_OTHER}")
11 add_definitions(${freeglut_STATIC_CFLAGS_OTHER})
15 add_library(test-shapes-gles1 SHARED test-shapes-gles1.c)
16 add_custom_target(apk ALL
17 DEPENDS test-shapes-gles1
18 COMMAND ant clean || true
19 COMMAND rm -rf libs/ src/ res/ bin/ gen/
20 COMMAND mkdir -p libs/armeabi/ src/ res/values/
21 COMMAND cp -a ${PROJECT_SOURCE_DIR}/AndroidManifest.xml ${PROJECT_BINARY_DIR}
22 COMMAND cp -a $<TARGET_FILE:test-shapes-gles1> libs/armeabi/
23 COMMAND echo '<?xml version="1.0" encoding="utf-8"?><resources><string name="app_name">FG_GLES1 test</string></resources>'
24 > res/values/strings.xml
25 COMMAND android update project --name cmake-apk --path . --target "android-10"
28 COMMAND adb shell am start -a android.intenon.MAIN -n freeglut.test.gles1/android.app.NativeActivity
30 # Note: at least one resource and an empty src/ dir is necessary for ant...
32 add_executable(test-shapes-gles1 test-shapes-gles1.c)
34 target_link_libraries(test-shapes-gles1 ${freeglut_STATIC_LIBRARIES})