Building FlightGear - Windows: Difference between revisions

Jump to navigation Jump to search
Line 139: Line 139:
== Getting OpenSceneGraph (OSG)==
== Getting OpenSceneGraph (OSG)==


* '''Step 1'''
* '''Intro'''
To build SimGear and FlightGear from CVS head, you'll usually need the latest version of OSG. OSG from SVN head might be the best choice.


To build SimGear and FlightGear from CVS head, you'll usually need the latest version of OSG. OSG from SVN head might be the best choice, but we don't have OSG for Windows build instructions prepared yet.
* '''Fetching "cutting edge" sources from SVN head'''
Use [http://tortoisesvn.net/ Tortoise SVN] to fetch the lastest source of OSG. The URL for the project archive is http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/. The destination folder should be '''OpenSceneGraph''' under your FlightGear project root directory. All other options can be left alone and are good to go as default. Wait until all files are downloaded from SVN.


You can however try and follow the building instructions from the OSG wiki, which make use of CMake: [http://www.openscenegraph.org/projects/osg/wiki/Build/CMake/]
* '''Dependencies'''<br>
OSG depends on some external libraries from the GnuWin project<br>
- [http://gnuwin32.sourceforge.net/packages/jpeg.htm Jpeg]<br>
- [http://gnuwin32.sourceforge.net/packages/libpng.htm Png]<br>
- [http://www.zlib.net/ ZLib]<br>
Download these packages and unzip them (including the folder structure) to your FG project folder\3rdparty. If you do not intend to create debug versions of OSG you can remove all links to debug files and *-bcc.lib in ...\3rdparty\lib.


Download the latest Windows binaries from this page: [http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-2.8.1/binaries/Windows/VisualStudio9/]  
* '''Preparing sources with CMake (generating project and solution files)'''
Get [http://www.cmake.org/cmake/resources/software.html CMake for Windows]. Extract all files from the archive to a folder of your choice (e.g. C:\DEV\CMake). Go to C:\DEV\CMake\bin and start '''cmake-gui.exe'''. Browse for the OSG source code (e.g. FlightGear project root\OpenSceneGraph) and enter this to the first line. Below this you'll find the path '''where to build the binaries'''. After entering the path to the souce code you'll find the same path here. Just add '''\build''' to this and you are now good to press '''Configure'''. If it did not happen before you'll now receive an information that your buld-folder was not found and cmake-gui asks you if it should be ceated for you. Press '''yes''' to do so.
Next specify you installed compiler (e.g. '''Visual Studio 9 2008'''). Set '''Use default native compiler''' and press '''Finish'''.
 
cmake-gui is now configuring everything so that you can use VC9 with OSG sources. But before you can go on you'll need to tweak cmake a little bit. After pressing Configure the first time, many red lines will appear in the middle window which points you to settings where you can customise your build. Chnage the view from '''Simple view''' to '''Advanced view''' to achieve more detailed settings. Some settings must be reviewed (e.g. ACTUAL_3RDPARTY_DIR, CMAKE_INSTALL_PREFIX, etc.).
 
In permission-restricted environments (like Vista or Windows 7) do '''not''' set CMAKE_INSTALL_PREFIX to a restricted folder like c:\program files as this will not work and lead to many '''permission denied''' messages as cmake can't elevate your rights. Use a permission free folder instead.
 
If you are satisfied with your cmake-options press configure 2, 3 or 4 times until '''Generate''' becomes active. Press it and wait until cmake-gui has finished to creat all neccesary folders/files for proceeding in Visual Studio (VC).
 
* '''Building in VC9'''
Switch to the folder '''Where to build binaries''' named before in cmake-gui and open the file '''OpenSceneGraph.sln''' with VC. Select your desired build type (Debug, Release, RelWithDebugInfo, MinSizeRel) and press '''F7''' to build the project. It's time for some coffee as this process will take some time. After all is done (hopefully) without errors right click the INSTALL project and build it. This will copy your compiled files to their correct locations (CMAKE_INSTALL_PREFIX). Before you do that all files reside in your build folder and it's not recommende to use them from there.
 
* '''Some additional words'''
The first compile run will take certain long time. After you finished the first build all further builds will work much faster. So updating SVN and recompiling the sources will not take too much time in the future. Just make sure: '''ALWAYS BUILD THE INSTALL PROJECT''' as this is part of the complete process. With this your newly built files will stay in your build but not in your install folder.
 
 
* '''Stable releases'''
You can however try and follow the building instructions from above to bet "cutting edge" with OSG.
Or you can download the latest Windows binaries from this page: [http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-2.8.1/binaries/Windows/VisualStudio9/]  


Get the archive(s) named "openscenegraph-all[...]". Get both the Release and Debug versions if you expect to do any debug builds of FlightGear. Otherwise, just the Release version should be fine.
Get the archive(s) named "openscenegraph-all[...]". Get both the Release and Debug versions if you expect to do any debug builds of FlightGear. Otherwise, just the Release version should be fine.
Line 159: Line 185:
* '''Step 3''' - Extract the OSG archive(s) you downloaded in Step 1 in the directory you created in Step 2.
* '''Step 3''' - Extract the OSG archive(s) you downloaded in Step 1 in the directory you created in Step 2.
* '''Step 4''' - Rename the resulting "OpenSceneGraph-[version]" directory to simply "OpenSceneGraph".
* '''Step 4''' - Rename the resulting "OpenSceneGraph-[version]" directory to simply "OpenSceneGraph".
This method is much more simple but the stable releases are far behind the actual development.


== Getting and compiling SimGear ==
== Getting and compiling SimGear ==
172

edits

Navigation menu