1. First choose a directory where you want to compile osgART (compilation directory). We advise you to put it either on your main development directory (e.g. Dev) or, better, in a specific directory where you generally build your libraries (e.g. _BUILD):
Be sure that your OpenSceneGraph installation (in OpenSceneGraph, OSG, OpenSceneGraph-3.x directories) or other plugins dependencies (e.g. opencv, artoolkit) are at the same level, few directories away or defined as environment variable (e.g. OSG_DIR).
2. Download the osgART source code at:
either as a zip using the built-in compression mechanism from github:
and unzip it in your compilation directory.
OR using git clone with a git or svn client (firstname.lastname@example.org:seichter/osgART.git), such as tortoise git, grabbing first the clone address:
and setup the correct path on your git to your compile directory:
Note: more options are available for git clone using different protocols (ssh, https, etc.), see https://help.github.com/articles/which-remote-url-should-i-use using github].
3. Start cmake and Drag’n Drop the osgART\CMakeLists.txt to your cmake gui. Setup a path to build osgART, preferably in a subdirectory named build (or build32, build64, buildES if you do multiple builds). Click on advanced on cmake to access advanced options:
4. Confirm the creation of the directory and choose the build target, such as Visual Studio 10 (VS2010), Visual Studio 11 (VS2012), etc:
Click Configure. cmake will look for OpenSceneGraph and propose you the different build options.
5. Setup your cmake:
- General options:
- CMAKE_CONFIGURATION_TYPES: Debug;Release;MinSizeRel;RelWithDebInfo. you can remove options you don’t really want to use.
- CMAKE_INSTALL_PREFIX: where you want to install your osgART compiled libraries, by default in C:\Program Files (x86)\osgART.
You can build it in a subdirectory such as, C:/Dev/osgART/build/precompiled, or in your Dev directory if you compiled in a _BUILD directory, or directly in your OSG directory.
- osgART options:
- - OSGART_BUILD_APIDOC: generate reference API (needs doxygen).
- OSGART_BUILD_APPLICATIONS: build default application such as osgart_viewer. default on.
- OSGART_BUILD_EXAMPLES: build all the examples. default off. If it’s your first installation, we advice you to enable this flag.
- OSGART_BUILD_SDK: this will package osg+osgart in a same directory during installation.
- OSGART_BUILDPLUGIN…: build the different tracking, video, sensor plugins. by default all dummy plugins will be build as they don’t need any dependencies.
For the additional plugins, dependencies libraries will be automatically requested (e.g. opencv include, lib directories, etc.).
6. click configure and generate. Open the sln solution file on your Visual Studio:
7. select the configuration (e.g. Release), and build your solution with a “Build All”.
Next, You can click on the “INSTALL” project (right click, Project Only, Build only INSTALL) to proceed to the installation.
Note: there is currently a bug in the installation so you need to copy osgART.dll (from build\bin\Debug or Release directory to the installation bin directory).
8. Last step is to setup some environment variables, either on your general configuration or directly on your console. For the general configuration, go to your control panel, select system, Advanced System Settings, Environment Variables:
on the console just define your variable with set:
The environment variables that you need:
- OSG environment variables (if you haven’t done so):
- OSG_DIR, OSG_ROOT: your OpenSceneGraph installation directory (where you have your bin, include, lib for OpenSceneGraph).
- OSG_FILE_PATH: where you put your scene data (generally points to OpenSceneGraph-data).
Add OSG_DIR\bin to your Path variable. (on console it will be: set Path=%Path%;%OSG_DIR%\bin OR set Path=%OSG_DIR%\bin;%Path%).
- osgART environment variables:
- OSG_FILE_PATH: modify this one to also point to [YOUR INSTALL DIR]\osgART\share\osgART\ (where the configuration files in data directory and media assets in media directory are defined).
- OSGART_DIR: home directory were you installed osgART.
- OSGART_PLUGIN_PATH: point to the installation directory where the osgART plugins are, we should be [YOUR INSTALL DIR]\osgART\bin\osgPlugins-x-x-x (x-x-x being your plugins version).
Add OSGART_DIR\bin to your Path variable. (on console it will be: set Path=%Path%;%OSGART_DIR%\bin OR set Path=%OSGART_DIR%\bin;%Path%).
If you do everything on console, with for examples osgART installed in Program Files, you will have:
you can after test your installation by running:
- osgartblank.exe you should get a standard osg viewer blue background without content,
If everything works, you ready for your first program !
if not please check if the plugins are found by setting the variable OSG_NOTIFY_LEVEL to for example DEBUG_FP, so you can see the trace where the plugins are tested.