Version 5 (modified by 14 years ago) (diff) | ,
---|
TracNav
Documentation
- Getting Started
BuildEnvironment
- Terrain Data
- Architecture
Modules...
osgVisual Configuration via XML...
- SerializationNotes
- ExecuterNotes
- CameraControl
- Theories of Terrain Deformation
- Theories of Image Distortion
- Home
About...
- Screenshots
- Downloads
Projection Designer...
- Wiki Edit
- Website Credits/Impressum
OSG & VPB Build Environment in Windows as Step-By-Step Tutorial
This HowTo shows one solution to create a good working OSG build environment on a windows operating system.
Prerequisites
- Install CMAKE from http://www.cmake.org/cmake/resources/software.html
- Download OSG sources
- Download prebuild 3rdParty libraries from http://www.openscenegraph.org/projects/osg/wiki/Downloads/Dependencies . Attention: Use the right version for your compiler, the wrong version can cause unpredicatlbe linking and runtime errors!
- Download the example data from http://www.osgvisual.org/projects/osgvisual/wiki/Downloads
Directory structure
The directory structure will be explaned on an example installation on drive D: :
Directory | Content | Source |
D:\OpenSceneGraph | Root folder of the OSG framework | - |
D:\OpenSceneGraph\gdal-1.6.x | gdal-1.6.x | Download precompiled from http://www.osgvisual.org/projects/osgvisual/wiki/Downloads |
D:\OpenSceneGraph\3rdParty | Folder containing the 3rdParty libraries in the subfolders x86 and x64 | Download from http://www.osgvisual.org/projects/osgvisual/wiki/Downloads |
D:\OpenSceneGraph\Data | Models and pictures for the OSG examples | http://www.osgvisual.org/projects/osgvisual/wiki/Downloads |
D:\OpenSceneGraph\OpenSceneGraph-2.9.9_x86 | Folder containing the real osg framwork compiled as 32 bit with its subfolders (bin lib include etc.) | Download newest version vom SVN trunk |
D:\OpenSceneGraph\OpenSceneGraph-2.9.9_x64 | Folder containing the real osg framwork compiled as 64 bit with its subfolders (bin lib include etc.) | Download newest version vom SVN trunk |
D:\OpenSceneGraph\VirtualPlanetBuilder | Folder for the VirtualPlanetBuilder installation. | Get newest version from SVN trunk |
Umgebungsvariablen setzen
Es sind folgende Umgebunsvariablen nötig:
- OSG D:\OpenSceneGraph\OpenSceneGraph-2.9.9\bin;D:\OpenSceneGraph?\3rdParty\bin;D:\OpenSceneGraph?\gdal-1.6.2\bin
- OSG_FILE_PATH D:\OpenSceneGraph\Data;D:\OpenSceneGraph?\Data\Images
- PATH erweitern mit ;%OSG%
- OSG_SCREEN 0 Nummer des Bildschirms, den OSG verwenden soll. es wird angefangen bei 0 zu zählen.
- OSG_NOTIFY_LEVEL Notify-Level für die Konsolen-Ausgabe, z.B.: WARN
- OSG_ROOT OSG-Wurzelverzeichnis, z.B.: D:\OpenSceneGraph?\OpenSceneGraph?-2.9.8
GDAL kompilieren
- Download GDAL SDK-Package (bottom of the page) from http://vbkto.dyndns.org/sdk/
- Open in VS2005 SP1 and compile.
- Create new gdal directory structure
<code> gdal-1.x.x
- bin
- include
- data
- lib
</code>
- If you have compiled successfully, populate this directories:
data | Content from SDK-Package/<GDAL>/data |
include | All includes files from SDK-Package/<GDAL> -- cpl_config.h will reside in different folders with different size, use the bigger one. |
bin | Copy all .exe and.dll into this directory |
lib | Copy gdal_i.lib into this directory |
- Delete your downloaded SDK to avoid that cmake will found this folder instead your build.
OSG Kompilieren
Die Reihenfolgedes kompilieren lautet
- CMAKE starten und Sourcecode wählen
- Sourcecode Verzeichnis: D:/OpenSceneGraph/OpenSceneGraph-2.9.8
- Build Binaries Verzeichnis: D:/OpenSceneGraph/OpenSceneGraph-2.9.8
- Optionen für gewähltes Sourcecodeverzeichnis einstellen
- ACTUAL_3RDPARTY_DIR D:/OpenSceneGraph/3rdparty
- CMAKE_INSTALL_PREFIX D:/OpenSceneGraph/OpenSceneGraph-2.9.8
- BUILD_MFC_EXAMPLES true (Diese Option erscheint erst, wenn BUILD_OSG_EXAMPLE auf true gesetzt wurde und einmal ein "Configure" ausgeführt wurde)
- BUILD_WRAPPER true
- configure ausführen, bei Fehlern diese beseitigen
- Generate ausführen -> MS Visual Studio Solution wird erzeugt
- D:/OpenSceneGraph/OpenSceneGraph-2.9.8 betreten und OpenSceneGraph?.sln öffnen
- BUILD_ALL einmal als Debug und einmal als Release kompilieren ( Bei Fehlern immer wieder OHNE Aufräumen kompilieren bis alle Fehler weg sind und der Compile gelingt)
Fertig! :)
Sollte beim Compile nicht gegen wldap32.lib gelinkt werden können: http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg20490.html