Superbuild on Windows: Difference between revisions

Jump to navigation Jump to search
m
cat: Building from source; etc
m (cat: Building from source; etc)
Line 1: Line 1:
Using Visual Studio / msbuild:
Using Visual Studio / msbuild:


==Requirements==
== Requirements ==
* CMake (version >= 2.6.4) for Windows
* CMake (version >= 2.6.4) for Windows
* SVN client (e.g. Win32SVN, TortoiseSVN ; see [[Tools of the Trade#Source Code Management / Revision Control Systems|here]])
* SVN client (e.g. Win32SVN, TortoiseSVN ; see [[Tools of the Trade#Source Code Management / Revision Control Systems|here]])
Line 10: Line 10:
* Optional: [http://www.microsoft.com/en-au/download/details.aspx?id=23691 Visual Studio 2010 SP1] (recommend you install this if you use the 2010 version; overcomes various issues users have had according to the forums.)
* Optional: [http://www.microsoft.com/en-au/download/details.aspx?id=23691 Visual Studio 2010 SP1] (recommend you install this if you use the 2010 version; overcomes various issues users have had according to the forums.)


==Cloning the repositories==
== Cloning the repositories ==
First of all, open your git shell client or the windows command prompt (cmd.exe), and change your working directory. If the location you want is on another disk or partition, before you must with cmd.exe type the mount point (e.g. C: ; D: ; ...). Example:
First of all, open your git shell client or the windows command prompt (<tt>cmd.exe</tt>), and change your working directory. If the location you want is on another disk or partition, before you must with <tt>cmd.exe</tt> type the mount point (e.g. <tt>C:</tt> ; <tt>D:</tt> ; ...). Example:
   C:\Users\Saggah>D:
   C:\Users\Saggah>D:
   D:\>cd Projets/
   D:\>cd Projets/
Line 24: Line 24:
   D:\Projets>git clone --recursive git://gitorious.org/fg/fgmeta.git
   D:\Projets>git clone --recursive git://gitorious.org/fg/fgmeta.git
If you have forgotten to specify --recursve, you will not get flighgear, simgear, maclauncher and fgrun folders.
If you have forgotten to specify <tt>--recursve</tt>, you will not get flighgear, simgear, maclauncher and fgrun folders.


We are on Windows so we don't really care about maclauncher:
We are on Windows so we don't really care about maclauncher:
Line 33: Line 33:
   D:\Projets\fgmeta>git submodule foreach git checkout next
   D:\Projets\fgmeta>git submodule foreach git checkout next


==Creating the solution==
== Creating the solution ==
Open CMake GUI and specify the location of your local repository including fgmeta. In the tutorial configuration, it is D:\Projets\fgmeta.
Open CMake GUI and specify the location of your local repository including fgmeta. In the tutorial configuration, it is <tt>D:\Projets\fgmeta</tt>.
Then, specify where you want to create the solution file. It's more conveniant to create it in another folder such as D:\Projets\fgbuild.
Then, specify where you want to create the solution file. It's more conveniant to create it in another folder such as <tt>D:\Projets\fgbuild</tt>.
Click on Configure and Yes if fgbuild folder was not created.
Click on Configure and Yes if fgbuild folder was not created.


Line 44: Line 44:
[[File:CMake_Windows_select_generator.png]]
[[File:CMake_Windows_select_generator.png]]


You should get two lines or more specifically two variables. The which one we interested in is the following "CMAKE_INSTALL_PREFIX". This is where your binaries, when built, will be installed (e.g. D:\Projets\fginstall).
You should get two lines or more specifically two variables. The which one we interested in is the following <tt>CMAKE_INSTALL_PREFIX</tt>. This is where your binaries, when built, will be installed (e.g. <tt>D:\Projets\fginstall</tt>).


[[File:CMake_Superbuild_Windows_after_configure.png]]
[[File:CMake_Superbuild_Windows_after_configure.png]]
Line 50: Line 50:
Press Generate and you can now exit CMake.
Press Generate and you can now exit CMake.


==Building the solution==
== Building the solution ==
Go in the build directory and open FlightGear-Meta.sln.
Go in the build directory and open FlightGear-Meta.sln.


Line 64: Line 64:
The first build is very long so be patient.
The first build is very long so be patient.
The meta solution should automatically install the binaries at the location specified in CMake.
The meta solution should automatically install the binaries at the location specified in CMake.
The FlightGear project of the meta solution does not contain the source code, so you should edit it by openning the FlightGear solution instead (e.g. D:\Projets\fgbuild\fgbuild\FlightGear.sln). And to be able to run the last built version, you must build the INSTALL project.
The FlightGear project of the meta solution does not contain the source code, so you should edit it by openning the FlightGear solution instead (e.g. <tt>D:\Projets\fgbuild\fgbuild\FlightGear.sln</tt>). And to be able to run the last built version, you must build the INSTALL project.


==Run fgfs==
== Run fgfs ==
To run FG with a debugger or not, it is recommended to execute it from the installation folder.
To run FG with a debugger or not, it is recommended to execute it from the installation folder.


First of all, I suggest you to add the folder "bin" of the OSG installation folder (e.g. D:\Projets\fginstall\msvc110-64\OpenSceneGraph\bin) and a 3rd party installation folder (e.g. D:\Projets\fgbuild\3rdParty.x64\bin) to the PATH environment variable.
First of all, I suggest you to add the folder "bin" of the OSG installation folder (e.g. <tt>D:\Projets\fginstall\msvc110-64\OpenSceneGraph\bin</tt>) and a 3rd party installation folder (e.g. <tt>D:\Projets\fgbuild\3rdParty.x64\bin</tt>) to the PATH environment variable.
To do that open the Windows Control Panel, open the Advanced System Properties, go the Advanced tab, click on the Environment Variables button.
To do that open the Windows Control Panel, open the Advanced System Properties, go the Advanced tab, click on the Environment Variables button.
Then search among the user variables "Path" and add the path in this variable (each paths must be separed by a ';'). Then, press OK on all the opened windows.
Then search among the user variables "Path" and add the path in this variable (each paths must be separed by a semicolon, "<tt>;</tt>"). Then, press OK on all the opened windows.


[[File:PATH_environment_variable_for_fgmeta.png]]
[[File:PATH_environment_variable_for_fgmeta.png]]
Line 78: Line 78:


To run the debugger on fgfs I also suggest you to open the FlightGear solution, set the fgfs as startup project (right-click on fgfs in the Solution Explorer window), then you must specify parameters such as the fgdata path.
To run the debugger on fgfs I also suggest you to open the FlightGear solution, set the fgfs as startup project (right-click on fgfs in the Solution Explorer window), then you must specify parameters such as the fgdata path.
So again right-click on fgfs, Properties, Configuration Properties -> Debugging, and set the line Command Arguments. Personnally I use:
So again right-click on fgfs, Properties, Configuration Properties -> Debugging, and set the line Command Arguments. Personally I use:
   --fg-root=D:/Projets/fgdata --fg-scenery=D:/Projets/fgdata/terrasync;D:/Projets/fgdata/Scenery --language=en --aircraft=ufo --airport=KSFO --disable-random-objects --disable-panel --disable-hud-3d --disable-ai-models --disable-ai-traffic --disable-real-weather-fetch --prop:/sim/rendering/texture-compression=off --prop:/sim/rendering/quality-level=0 --prop:/sim/rendering/shaders/quality-level=0 --prop:/sim/rendering/random-vegetation=0 --prop:/sim/rendering/random-buildings=0 --prop:/sim/ai/enabled=0 --disable-fgcom --disable-specular-highlight --disable-clouds --disable-clouds3d --prop:/sim/rendering/particles=0
   --fg-root=D:/Projets/fgdata --fg-scenery=D:/Projets/fgdata/terrasync;D:/Projets/fgdata/Scenery --language=en --aircraft=ufo --airport=KSFO --disable-random-objects --disable-panel --disable-hud-3d --disable-ai-models --disable-ai-traffic --disable-real-weather-fetch --prop:/sim/rendering/texture-compression=off --prop:/sim/rendering/quality-level=0 --prop:/sim/rendering/shaders/quality-level=0 --prop:/sim/rendering/random-vegetation=0 --prop:/sim/rendering/random-buildings=0 --prop:/sim/ai/enabled=0 --disable-fgcom --disable-specular-highlight --disable-clouds --disable-clouds3d --prop:/sim/rendering/particles=0


When you launch fgfs with the debugger, you will get a very low framerate, this is why it's important to disable most of the features and use settings for low-end computers.
When you launch fgfs with the debugger, you will get a very low framerate, this is why it's important to disable most of the features and use settings for low-end computers.


==Build last commits==
== Build last commits ==
If the code of the remote repository has changed you can build the last commits by a git pull in your cloned repository:
If the code of the remote repository has changed you can build the last commits by a git pull in your cloned repository:
     git submodule foreach git pull
     git submodule foreach git pull
Line 89: Line 89:
Then, build again with Visual Studio.
Then, build again with Visual Studio.


==Troubleshootings==
== Troubleshootings ==


* Some people experience problem with CMake >= 3.0, so if you get the following error when the solution is building, switch to CMake 2.8.12:
* Some people experience problem with CMake >= 3.0, so if you get the following error when the solution is building, switch to CMake 2.8.12:
   error MSB6006: "cmd.exe" exited with code 1
   error MSB6006: "cmd.exe" exited with code 1
* It is possible you get an error such as "Failed to open font file" although the font exist at the location specified. In this case, this is due to the missing OSG plugin osgdb_freetype.dll in D:\Projets\fginstall\msvc110-64\OpenSceneGraph\bin for example. Personally, I did dot start thinking about the problem. Sorry...
* It is possible you get an error such as "Failed to open font file" although the font exist at the location specified. In this case, this is due to the missing OSG plugin <tt></tt>osgdb_freetype.dll in <tt></tt>D:\Projets\fginstall\msvc110-64\OpenSceneGraph\bin for example. Personally, I did dot start thinking about the problem. Sorry...




For any other problems you are facing, please report in on the board.
For any other problems you are facing, please report in on the board.
[[Category:Building from source‎]]

Navigation menu