HTTPS SSH

Overview

mjin-player is a cross-platform application that serves as a base for the rest of MJIN world

Build

Assumptions:

  • Git (git command) is installed
  • Mercurial (hg command) is installed
  • ~/mjin/build/mjin-player/<platform> is the build directory for mjin-player
  • ~/mjin/src/mjin-player is the source directory for mjin-player
  • You have read OpenSceneGraph cross-platform guide

<platform> is one of:

  • linux
  • macos
  • windows
  • web

Notes:

1. Linux

Assumptions:

  • Xubuntu 16.04
  • CMake

Instructions:

  • sudo apt install build-essential
  • sudo apt install libopenscenegraph-dev
  • mkdir ~/mjin/build/mjin-player/linux
  • cd ~/mjin/build/mjin-player/linux
  • cmake ~/mjin/src/mjin-player
  • make

2. macOS

Assumptions:

  • macOS Sierra
  • brew

Instructions:

  • brew install cmake open-scene-graph
  • mkdir ~/mjin/build/mjin-player/macos
  • cd ~/mjin/build/mjin-player/macos
  • cmake -G Xcode ~/mjin/src/mjin-player
  • xcodebuild -configuration Release

3. Windows

Assumptions:

  • Windows 7
  • MSYS2 with:
    • installed Git, Mercurial, CMake, GCC: pacman -S mingw-w64-i686-cmake mingw-w64-i686-make mingw-w64-i686-gcc git mercurial
    • MinGW-w64 bin directory added to PATH
    • updated CMake MinGW script

Instructions (for MSYS2 console):

  • pacman -S mingw-w64-i686-OpenSceneGraph
  • mkdir ~/mjin/build/mjin-player/windows
  • cd ~/mjin/build/mjin-player/windows
  • cmake -G "MinGW Makefiles" ~/mjin/src/mjin-player
  • make

4. Android

Assumptions:

  • Xubuntu 16.04
  • latest Android Studio installed
  • latest OpenSceneGraph sources at ~/mjin/src/OpenSceneGraph

Instructions:

  • open Android Studio project located at ~/mjin/src/mjin-player/platform/android
  • press Run button to build and run the project

Notes:

  • mjin-player is only built for armeabi-v7a, this is specified in app's build.gradle file
  • OpenSceneGraph is built inside its own build directory at ~/mjin/src/OpenSceneGraph/build/armeabi-v7a
  • OpenSceneGraph is only rebuilt if its build directory does not exist

5. iOS

Assumptions:

  • macOS Sierra
  • latest Xcode installed
  • latest OpenSceneGraph sources at ~/mjin/src/OpenSceneGraph

Instructions:

  • cd ~/mjin/src/mjin-player/platform/ios/player
  • mkdir build
  • cd build
  • cmake -G Xcode ..
  • xcodebuild -IDEBuildOperationMaxNumberOfConcurrentCompileTasks=8 -configuration Release -sdk iphonesimulator
  • open Xcode project located at ~/mjin/src/mjin-player/platform/ios/mjin-player
  • press Run button to build and run the project

Notes:

  • mjin-player is built for Simulator by default, you need to run cmake -G Xcode -DBUILD_SIMULATOR=NO .. to build libplayer.a for device
  • OpenSceneGraph is built inside its own build directory at ~/mjin/src/OpenSceneGraph/build/Simulator (or build/Device)
  • OpenSceneGraph is only rebuilt if its build directory does not exist

6. Web

Assumptions:

  • Xubuntu 16.04
  • CMake
  • latest portable Emscripten SDK installed at ~/emsdk-portable
  • latest OpenSceneGraph sources at ~/mjin/src/OpenSceneGraph

Instructions:

  • mkdir ~/mjin/build/mjin-player/web
  • cd ~/mjin/build/mjin-player/web
  • cmake -DCMAKE_TOOLCHAIN_FILE=~/emsdk-portable/emscripten/<version>/cmake/Modules/Platform/Emscripten.cmake ~/mjin/src/mjin-player/platform/web
  • make

Notes:

  • use Emscripten version instead of <version> during configuration
  • OpenSceneGraph is built inside its own build directory at ~/mjin/src/OpenSceneGraph/build/Emscripten
  • OpenSceneGraph is only rebuilt if its build directory does not exist

Help

If you have problems building mjin-player, create an issue. We'll sort it out together.