Use different names for GLES1 and GLES2 libraries, to allow parallel install
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1233 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
53c5a0c8c6
commit
86545861dc
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -15,8 +15,9 @@ freeglut/freeglut/README.mac -text
|
||||
freeglut/freeglut/README.mingw_cross svn_keywords=Author+Date+Id+Revision
|
||||
freeglut/freeglut/README.win32 svn_keywords=Author+Date+Id+Revision
|
||||
freeglut/freeglut/TODO svn_keywords=Author+Date+Id+Revision
|
||||
freeglut/freeglut/android/Android.mk -text
|
||||
freeglut/freeglut/android/README -text
|
||||
freeglut/freeglut/android/gles1/Android.mk -text
|
||||
freeglut/freeglut/android/gles2/Android.mk -text
|
||||
freeglut/freeglut/android_toolchain.cmake -text
|
||||
freeglut/freeglut/config.h.in svn_keywords=Author+Date+Id+Revision
|
||||
freeglut/freeglut/doc/download.html svn_keywords=Author+Date+Id+Revision
|
||||
|
@ -297,8 +297,16 @@ ELSE()
|
||||
# - the shared library should link to the dependency libraries so that the user
|
||||
# won't have to link them explicitly (they shouldn't have to know that we depend
|
||||
# on Xrandr or Xxf86vm)
|
||||
SET_TARGET_PROPERTIES(freeglut PROPERTIES VERSION 3.9.0 SOVERSION 3 OUTPUT_NAME glut)
|
||||
SET_TARGET_PROPERTIES(freeglut_static PROPERTIES OUTPUT_NAME glut)
|
||||
IF(FREEGLUT_GLES2)
|
||||
SET(LIBNAME freeglut-gles2)
|
||||
ELSEIF(FREEGLUT_GLES1)
|
||||
SET(LIBNAME freeglut-gles1)
|
||||
ELSE()
|
||||
SET(LIBNAME glut)
|
||||
ENDIF()
|
||||
|
||||
SET_TARGET_PROPERTIES(freeglut PROPERTIES VERSION 3.9.0 SOVERSION 3 OUTPUT_NAME ${LIBNAME})
|
||||
SET_TARGET_PROPERTIES(freeglut_static PROPERTIES OUTPUT_NAME ${LIBNAME})
|
||||
IF(ANDROID)
|
||||
# Not in CMake toolchain file, because the toolchain
|
||||
# file is called several times and generally doesn't
|
||||
@ -405,12 +413,18 @@ ELSE()
|
||||
ENDIF()
|
||||
# Client applications need to define FreeGLUT GLES version to
|
||||
# bootstrap headers inclusion in freeglut_std.h:
|
||||
SET(PC_LIBNAME "glut")
|
||||
SET(PC_FILENAME "freeglut.pc")
|
||||
IF(FREEGLUT_GLES2)
|
||||
SET(PC_CFLAGS "-DFREEGLUT_GLES2")
|
||||
SET(PC_LIBNAME "freeglut-gles2")
|
||||
SET(PC_FILENAME "freeglut-gles2.pc")
|
||||
ELSEIF(FREEGLUT_GLES1)
|
||||
SET(PC_CFLAGS "-DFREEGLUT_GLES1")
|
||||
SET(PC_LIBNAME "freeglut-gles1")
|
||||
SET(PC_FILENAME "freeglut-gles1.pc")
|
||||
ENDIF()
|
||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/freeglut.pc.in ${CMAKE_BINARY_DIR}/freeglut.pc @ONLY)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/freeglut.pc DESTINATION share/pkgconfig)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/freeglut.pc DESTINATION share/pkgconfig/ RENAME ${PC_FILENAME})
|
||||
# TODO: change the library and .pc name when building for GLES,
|
||||
# e.g. -lglut-GLES2
|
||||
|
@ -22,7 +22,7 @@ Create a module compatible with the NDK build-system
|
||||
cd cross-android-module/
|
||||
cmake \
|
||||
-D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
|
||||
-D CMAKE_INSTALL_PREFIX=/freeglut \
|
||||
-D CMAKE_INSTALL_PREFIX=/freeglut-gles2 \
|
||||
-D FREEGLUT_GLES2=ON \
|
||||
-D FREEGLUT_BUILD_DEMOS=NO \
|
||||
..
|
||||
@ -31,17 +31,17 @@ Create a module compatible with the NDK build-system
|
||||
|
||||
- Copy Android.mk in the new 'freeglut/' directory :
|
||||
|
||||
cp android/Android.mk freeglut/
|
||||
cp ../android/gles2/Android.mk freeglut-gles2/
|
||||
|
||||
- Reference this module in your jni/Android.mk:
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := ... freeglut
|
||||
LOCAL_STATIC_LIBRARIES := ... freeglut-gles2
|
||||
...
|
||||
$(call import-module,freeglut)
|
||||
$(call import-module,freeglut-gles2)
|
||||
|
||||
- You now can point your NDK_MODULE_PATH to this module!
|
||||
|
||||
ndk-build NDK_MODULE_PATH=/usr/src/freeglut-3.0.0/freeglut/
|
||||
ndk-build NDK_MODULE_PATH=/usr/src/freeglut-3.0.0/cross-android-module/freeglut-gles2/
|
||||
|
||||
|
||||
Compile FreeGLUT for a traditional cross-compiler environment
|
||||
|
@ -2,8 +2,8 @@ LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := freeglut
|
||||
LOCAL_SRC_FILES := lib/libglut.a
|
||||
LOCAL_MODULE := freeglut-gles1
|
||||
LOCAL_SRC_FILES := lib/libfreeglut-gles1.a
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
|
||||
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
9
freeglut/freeglut/android/gles2/Android.mk
Normal file
9
freeglut/freeglut/android/gles2/Android.mk
Normal file
@ -0,0 +1,9 @@
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := freeglut-gles2
|
||||
LOCAL_SRC_FILES := lib/libfreeglut-gles2.a
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
|
||||
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
@ -5,6 +5,6 @@ includedir=${prefix}/include
|
||||
Name: glut
|
||||
Description: A freely licensed and improved alternative to the GLUT library
|
||||
Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
|
||||
Libs: -L${libdir} -lglut
|
||||
Libs: -L${libdir} -l@PC_LIBNAME@
|
||||
Libs.private: @PC_LIBS_PRIVATE@
|
||||
Cflags: -I${includedir} @PC_CFLAGS@
|
||||
|
Reference in New Issue
Block a user