[Ves] VES+QT to Android

Vincent Kaestle vincent.kaestle at gmail.com
Mon Apr 7 06:14:49 EDT 2014


During link process, I got an error :
vtk-android/lib/libvtktiff-6.0.a(fFieldInfoByName: error: undefined
reference to 'lfind'

I guess the problem comes from *qt5_use_modules* function that I use in my
CMakelists.txt. If you may have a look of the file, I put it as an
attachment. Thanks

Vincent





2014-04-07 9:42 GMT+02:00 Vincent Kaestle <vincent.kaestle at gmail.com>:

> Thanks for your both answers.
>
> Pat, it helps me a lot, I'm going to try that.
> Aashish, it would be perfect if you share your code ! It will make the
> task easier ! Let me know when you push it on git.
>
> Vincent
>
>
> 2014-04-04 17:30 GMT+02:00 Aashish Chaudhary <
> aashish.chaudhary at kitware.com>:
>
> Hi Vincent,
>>
>>
>> On Fri, Apr 4, 2014 at 11:12 AM, Vincent Kaestle <
>> vincent.kaestle at gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I'm trying something a little tricky : I would like to insert a VES
>>> visualisation inside a Qt5 Application for Android.
>>>
>>> To deploy a Qt5 Application on Android, those parts of code are
>>> important :
>>>
>>>    - java interfaces<https://qt.gitorious.org/qt/qtbase/source/src/android>, particularly :
>>>    QtApplication.java<https://qt.gitorious.org/qt/qtbase/source/src/android/java/src/org/qtproject/qt5/android/bindings/QtApplication.java>
>>>     QtActivity.java<https://qt.gitorious.org/qt/qtbase/source/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java>
>>>    QtSurface.java<https://qt.gitorious.org/qt/qtbase/source/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java>
>>>
>>>
>>> My question is : What is the best way to achieve this ?
>>>
>>> Should I :
>>>
>>>    - Try to blend QtSurface.java with KiwiViewerActivity.java, then
>>>    test with Kiwi App ?
>>>    - Or directly use VES lib inside a QGLWidget, but how ?
>>>
>>>
>>> I started working on it some time back but didn't get time to finish it.
>> I am glad that you bought it up. I was working towards directly using the
>> VES lib inside a QGLWidget. If its Ok with you,
>> we can probably share the code and push it to VES eventually. Let me know
>> if this sounds good to you.
>>
>> - Aashish
>>
>>
>>
>>>  By the way, I think it may be great to have a simple and minimal VES
>>> example, like a view with only one 3D object and no gesture control.
>>> Because it looks like the only way to start making an App is to start from
>>> Kiwi example.
>>>
>>>
>>> Thank you in advance for your advice,
>>>
>>> Vincent K
>>>
>>> _______________________________________________
>>> Ves mailing list
>>> Ves at public.kitware.com
>>> http://public.kitware.com/cgi-bin/mailman/listinfo/ves
>>>
>>>
>>
>>
>> --
>> | Aashish Chaudhary
>> | R&D Engineer
>> | Kitware Inc.
>> | www.kitware.com
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ves/attachments/20140407/c66657e3/attachment-0003.html>
-------------- next part --------------
cmake_minimum_required(VERSION 2.8.3)

project(TestQtVesBuilder)

set(QT_DIR "D:/Qt/Qt5.2.1/5.2.1" CACHE PATH "path to Qt")
set(VES_SUPERBUILD "D:/VES/VES_master2/build2/CMakeExternals/Build" CACHE PATH "path to Build dir of VES superbuild")
set(ANDROID_ABI_QT "android_armv7" CACHE STRING "ABI dir in Qt")
set(ANDROID_ARCH_NDK "arch-arm" CACHE STRING "ARCH dir in NDK")
set(ANDROID_APK_DEBUGGABLE "TRUE" CACHE STRING "DEBUG AndroidManifest.xml")
set(QT_LIB_DIR ${QT_DIR}/${ANDROID_ABI_QT}/lib)

# Required to create APK
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake_tools/android.apk.cmake" REQUIRED)

# Required to use VES
set(VTK_DIR "${VES_SUPERBUILD}/vtk-android")
set(VES_DIR "${VES_SUPERBUILD}/ves-android")
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
find_package(VES REQUIRED)
include_directories(${VES_INCLUDE_DIRS})

# Qt packages
set(CMAKE_AUTOMOC ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${QT_LIB_DIR}/cmake/Qt5Widgets ${QT_LIB_DIR}/cmake/Qt5OpenGL)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5OpenGL REQUIRED)

# Test project : includes, src
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
set(MAIN_LIB_NAME test_qt_ves)
set(MAIN_SRC
	src/kiwi.cpp
	src/mainwidget.cpp
	src/main.cpp
)
add_library(${MAIN_LIB_NAME} SHARED ${MAIN_SRC})

# Add options to use Qt Modules inside project
qt5_use_modules(${MAIN_LIB_NAME} Widgets OpenGL)

# ADD other libs
add_library(libEGL SHARED IMPORTED)
set_target_properties(libEGL PROPERTIES IMPORTED_LOCATION ${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/${ANDROID_ARCH_NDK}/usr/lib/libEGL.so)
add_library(libGLESv2 SHARED IMPORTED)
set_target_properties(libGLESv2 PROPERTIES IMPORTED_LOCATION ${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/${ANDROID_ARCH_NDK}/usr/lib/libGLESv2.so)

target_link_libraries(${MAIN_LIB_NAME} libEGL libGLESv2 android log ${VES_LIBRARIES})

# MESSAGE("LINKER_FLAGS= ${LINKER_FLAGS}")
# MESSAGE("CMAKE_CXX_FLAGS= ${CMAKE_CXX_FLAGS}")
# MESSAGE("CMAKE_C_FLAGS= ${CMAKE_C_FLAGS}")

# Libs needed in APK
set(APP_SHARED_LIBRARIES
	${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_COMPILER_VERSION}/libs/${ANDROID_ABI}/libgnustl_shared.so
	
	${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/${ANDROID_ARCH_NDK}/usr/lib/libEGL.so
	${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/${ANDROID_ARCH_NDK}/usr/lib/libGLESv2.so
	
	${QT_LIB_DIR}/../plugins/platforms/libqminimal.so
	${QT_LIB_DIR}/../plugins/platforms/libqoffscreen.so
	${QT_LIB_DIR}/../plugins/accessible/libqtaccessiblewidgets.so
	${QT_LIB_DIR}/../plugins/platforms/android/libqtforandroid.so
	${QT_LIB_DIR}/../plugins/platforms/android/libqtforandroidGL.so
	
	${QT_LIB_DIR}/../plugins/imageformats/libqgif.so
	${QT_LIB_DIR}/../plugins/imageformats/libqico.so
	${QT_LIB_DIR}/../plugins/imageformats/libqjpeg.so
	${QT_LIB_DIR}/../plugins/imageformats/libqmng.so
	${QT_LIB_DIR}/../plugins/imageformats/libqtga.so
	${QT_LIB_DIR}/../plugins/imageformats/libqtiff.so
	${QT_LIB_DIR}/../plugins/imageformats/libqwbmp.so
	
	${QT_LIB_DIR}/libQt5Core.so
	${QT_LIB_DIR}/libQt5Gui.so
	${QT_LIB_DIR}/libQt5Widgets.so
	${QT_LIB_DIR}/libQt5OpenGL.so
	
	${LIBRARY_OUTPUT_PATH}/lib${MAIN_LIB_NAME}.so
)

set(APP_ASSETS
	# ${CMAKE_CURRENT_SOURCE_DIR}/res/cube.png
	# ${CMAKE_CURRENT_SOURCE_DIR}/res/fshader.glsl
	# ${CMAKE_CURRENT_SOURCE_DIR}/res/vshader.glsl
)

# Definitions for Java/AndroidManifest.xml - QT system
set(BASE_APP_NAME TestQtVes)
set(BASE_APP_LIB_NAME ${MAIN_LIB_NAME})
set(BASE_BUNDLED_LIBS
)
set(BASE_BUNDLED_IN_LIBS	
	<item>libqminimal.so:plugins/platforms/libqminimal.so</item>
	<item>libqoffscreen.so:plugins/platforms/libqoffscreen.so</item>
	<item>libqtaccessiblewidgets.so:plugins/accessible/libqtaccessiblewidgets.so</item>
	<item>libqtforandroid.so:plugins/platforms/android/libqtforandroid.so</item>
	<item>libqtforandroidGL.so:plugins/platforms/android/libqtforandroidGL.so</item>
	
	<item>libqmng.so:plugins/imageformats/libqgif.so</item>
	<item>libqmng.so:plugins/imageformats/libqico.so</item>
	<item>libqmng.so:plugins/imageformats/libqjpeg.so</item>
	<item>libqmng.so:plugins/imageformats/libqmng.so</item>
	<item>libqmng.so:plugins/imageformats/libqtga.so</item>
	<item>libqmng.so:plugins/imageformats/libqtiff.so</item>
	<item>libqmng.so:plugins/imageformats/libqwbmp.so</item>
)
set(BASE_QT_LIBS
	<item>gnustl_shared</item>
	<item>Qt5Core</item>
	<item>Qt5Gui</item>
	<item>Qt5Widgets</item>
	<item>Qt5OpenGL</item>
)
set(BASE_BUNDLED_IN_ASSETS
)

# Launch APK creation
android_create_apk(${MAIN_LIB_NAME} "${CMAKE_BINARY_DIR}/apk" "${APP_SHARED_LIBRARIES}" "${APP_ASSETS}" "data")


More information about the Ves mailing list