[osg-users] [build] Building OSG for Android -- Windowing system issue

163 views
Skip to first unread message

Brett Haines

unread,
Apr 23, 2017, 7:54:46 AM4/23/17
to osg-...@lists.openscenegraph.org
Hello all,

I'm trying to build OSG for Android, but I'm having some issues with it finding X11. From what I understand it's not supposed to be looking for X11 at all, but setting the windowing system to "None" results in "Windowing system not supported". Below are pastebins of the Bash script I used, and the results of that build. My host system is Ubuntu 16.04, and I'm using Crystax for my Android NDK.

pastebin dot com Z8CAs1v3

pastebin dot com QRvhSvpn

Any tips about what I'm doing wrong would be greatly appreciated.

Thank you!

Brett

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70814#70814





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

michael kapelko

unread,
Apr 23, 2017, 8:35:33 AM4/23/17
to OpenSceneGraph Users
Hi.

I'm currently working on a set of tutorials for OSG: https://github.com/OGStudio/openscenegraph-cross-platform-guide
I've just finished re-doing Android support for sample application: https://github.com/OGStudio/openscenegraph-cross-platform-guide-application

The tutorial for Android is in the process, but if you're interested to do it yourself, here's the Android-only part for the sample application: https://bitbucket.org/kornerr/android-osg-tutorial (You can open it in AndroidStudio)
Its CMakeLists.txt builds OpenSceneGraph as a static library. It also builds android-static-lib, but you can safely remove it, since this was just a test.

The crucial CMake OSG options are in build.gradle file: https://bitbucket.org/kornerr/android-osg-tutorial/src/tip/app/build.gradle?at=default&fileviewer=file-view-default

I plan to finish the tutorial in a week or two, so you may want to revisit the guide later for a complete Android tutorial.



2017-04-23 9:01 GMT+07:00 Brett Haines <bhain...@gmail.com>:
Hello all,

I'm trying to build OSG for Android, but I'm having some issues with it finding X11.  From what I understand it's not supposed to be looking for X11 at all, but setting the windowing system to "None" results in "Windowing system not supported".  Below are pastebins of the Bash script I used, and the results of that build.  My host system is Ubuntu 16.04, and I'm using Crystax for my Android NDK.

pastebin dot com Z8CAs1v3

pastebin dot com QRvhSvpn

Any tips about what I'm doing wrong would be greatly appreciated.

Thank you!

Brett

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70814#70814





_______________________________________________
osg-users mailing list

Brett Haines

unread,
Apr 26, 2017, 5:40:05 PM4/26/17
to osg-...@lists.openscenegraph.org
Thank you for the links Kornerr -- I'll definitely be keeping an eye on that.

I did figure out that my issue was not using the toolchain file in the OpenSceneGraph repo. Adding the following option to CMake got it going:


Code:

-D CMAKE_TOOLCHAIN_FILE=$BASEDIR/openscenegraph/PlatformSpecifics/Android/android.toolchain.cmake




I also had to remove the lines that specified my C and C++ compilers. For whatever reason, setting those manually caused CMake to not find them.

Cheers,
Brett

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70844#70844

michael kapelko

unread,
Apr 27, 2017, 11:54:27 PM4/27/17
to OpenSceneGraph Users
Hi.
I tried to use android.toolchain.cmake, too, but that requires configuration and building outside AndroidStudio. I ended up simply including OSG as 'add_subdirectory' into native-lib's CMakeLists.txt that AndroidStudio creates. That way, OSG is built as a dependency whenever native-lib is built. Such approach removes the need for doing anything outside AndroidStudio, referencing external toolchain file, and you get OSG built for those ABIs that you specified in 'abiFilters'.

I plan to publish Android tutorial with the mentioned approach next week.

2017-04-27 4:43 GMT+07:00 Brett Haines <bhain...@gmail.com>:
Thank you for the links Kornerr -- I'll definitely be keeping an eye on that.

I did figure out that my issue was not using the toolchain file in the OpenSceneGraph repo.  Adding the following option to CMake got it going:


Code:

  -D CMAKE_TOOLCHAIN_FILE=$BASEDIR/openscenegraph/PlatformSpecifics/Android/android.toolchain.cmake




I also had to remove the lines that specified my C and C++ compilers.  For whatever reason, setting those manually caused CMake to not find them.

Cheers,
Brett

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70844#70844





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

michael kapelko

unread,
May 4, 2017, 1:23:49 PM5/4/17
to OpenSceneGraph Users
If you have any questions or ideas, I'd be glad to hear from you.






_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Reply all
Reply to author
Forward
0 new messages