Building using CMake - Windows: Difference between revisions

Jump to navigation Jump to search
Split the directory section in 32-bits and 64-bits for clarity (and because they require different downloads)
m (Add info about max allowed users on ftp server)
(Split the directory section in 32-bits and 64-bits for clarity (and because they require different downloads))
Line 5: Line 5:
* [http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express Microsoft Visual Studio 2010 Express]
* [http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express Microsoft Visual Studio 2010 Express]
* [http://code.google.com/p/msysgit/ msysGit]
* [http://code.google.com/p/msysgit/ msysGit]
* [http://www.microsoft.com/en-us/download/details.aspx?id=8279 Microsoft Windows SDK] (only for 64-bit builds)


== Directory tree ==
== Directory tree ==
On Windows, assumptions on the directory structure are made to automate the discovery of dependencies.
On Windows, assumptions on the directory structure are made to automate the discovery of dependencies.


This recommended directory structure is described below. Clicking the links allows you to download pre-built parts (for 3rdParty, make sure to download the right bits version. You need only one of the zips.).
This recommended directory structure is described below. Clicking the links allows you to download pre-built parts (for 3rdParty, make sure to download the right bits version. You need only one of the zips.). If you do not use the recommended structure you will need to enter paths by hand. Source and build directories can be located anywhere.
 
'''If you get a login dialog on the ftp server listed above, this means that the max allowed users are reach. Please try a few minutes later.'''
 
=== 32-bits ===
<tt>
<tt>
: ${MSVC_3RDPARTY_ROOT} /
: ${MSVC_3RDPARTY_ROOT} /
Line 19: Line 24:
::: boost /
::: boost /
:: install /
:: install /
::: msvc100 / </tt> ( for VS2010 32 bits, or msvc90, msvc90-64 or msvc100-64 for VS2008 32, VS2008 64 and VS2010 64 ) <tt>
::: msvc100 / </tt> ( for VS2010 32 bits, or msvc90 for VS2008 32-bits ) <tt>
:::: [http://flightgear.simpits.org:8080/job/OSG-stable-Win/lastSuccessfulBuild/artifact/*zip*/archive.zip OpenSceneGraph] / </tt> ( OSG CMake install ) <tt>
:::: [http://flightgear.simpits.org:8080/job/OSG-stable-Win/lastSuccessfulBuild/artifact/*zip*/archive.zip OpenSceneGraph] / </tt> ( OSG CMake install ) <tt>
::::: bin /
::::: bin /
Line 31: Line 36:
::::: lib /</tt>
::::: lib /</tt>


'''If you get a login dialog on the ftp server listed above, this means that the max allowed users are reach. Please try a few minutes later.'''
=== 64-bits ===
 
When building a 64 bits version, use the following structure for the 3dparty tools:
<tt>
<tt>
:: [ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/ 3rdParty.x64] / </tt> ( 64 bit version ) <tt>
: ${MSVC_3RDPARTY_ROOT} /
:: [ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/ 3rdParty.x64] /
::: bin /
::: bin /
::: include /
::: include /
::: lib /</tt>
::: lib /
 
:: boost_1_44_0 / </tt> (included in the 3rdParty package linked above) <tt>
::: boost /
If you do not use the recommended structure you will need to enter paths by hand. Source and build directories can be located anywhere.
:: install /
::: msvc100-64 / </tt> ( for VS2010 64-bits, or msvc90-64 for VS2008 64-bits ) <tt>
:::: [http://flightgear.simpits.org:8080/job/OSG-stable-Win64/lastSuccessfulBuild/artifact/*zip*/archive.zip OpenSceneGraph] / </tt> ( OSG CMake install ) <tt>
::::: bin /
::::: include /
::::: lib /
:::: SimGear / </tt> (create this empty for now, subfolders will be created by build process) <tt>
::::: include /
::::: lib /
:::: FlightGear / </tt> (create this empty for now) <tt>
::::: include /
::::: lib /</tt>


NdT: glut is missing for the 64bits build, you can use [http://www.transmissionzero.co.uk/software/freeglut-devel/ freeglut].
NdT: glut is missing for the 64bits build, you can use [http://www.transmissionzero.co.uk/software/freeglut-devel/ freeglut].
Line 51: Line 66:
## Set <tt>"Where is the source code"</tt> to wherever you put the SimGear sources (from the released tarball or the git repository).
## Set <tt>"Where is the source code"</tt> to wherever you put the SimGear sources (from the released tarball or the git repository).
## Set <tt>"Where to build the binaries"</tt> to a new empty directory (could be anywhere and any name, for example naming it simgear-build, at the same folder location as your unzipped SimGear source folder was put).
## Set <tt>"Where to build the binaries"</tt> to a new empty directory (could be anywhere and any name, for example naming it simgear-build, at the same folder location as your unzipped SimGear source folder was put).
## Press [[File:CMake GUI Configure.png]]. The first time that the project is configured, CMake will bring up a window asking you to "Specify the generator for this project" i.e. which compiler you wish to use. Select Visual Studio 10, (or Visual Studio 10 Win64 for 64 bit), and press Finish. CMake will now do a check on your system and will produce a preliminary build configuration.
## Press [[File:CMake GUI Configure.png]]. The first time that the project is configured, CMake will bring up a window asking you to "Specify the generator for this project" i.e. which compiler you wish to use. Select Visual Studio 10 (or Visual Studio 10 Win64 for 64-bit), and press Finish. CMake will now do a check on your system and will produce a preliminary build configuration.
## CMake adds new configuration variables in red. Some have a value ending with <tt>-NOTFOUND</tt>. These variables should receive your attention. Some errors will prevent SimGear from building and others will simply invalidate some options without causing build errors.  
## CMake adds new configuration variables in red. Some have a value ending with <tt>-NOTFOUND</tt>. These variables should receive your attention. Some errors will prevent SimGear from building and others will simply invalidate some options without causing build errors.  
### First check the <tt>MSVC_3RDPARTY_ROOT</tt> variable. If it is not set, chances are that there will be a lot of <tt>-NOTFOUND</tt> errors. Instead of trying to fix every error individually, set that variable to the location of the directory structure that is presented above. Then press [[File:CMake GUI Configure.png]] again.
### First check the <tt>MSVC_3RDPARTY_ROOT</tt> variable. If it is not set, chances are that there will be a lot of <tt>-NOTFOUND</tt> errors. Instead of trying to fix every error individually, set that variable to the location of the directory structure that is presented above. Then press [[File:CMake GUI Configure.png]] again.
Line 59: Line 74:
## Press [[File:CMake GUI Generate.png]].
## Press [[File:CMake GUI Generate.png]].
## Start Visual Studio 2010 and load the SimGear solution (SimGear.sln) located in <tt>"Where to build the binaries"</tt>.
## Start Visual Studio 2010 and load the SimGear solution (SimGear.sln) located in <tt>"Where to build the binaries"</tt>.
## Choose the <tt>"Release"</tt> build in the VS2010 "Generation" toolbar[[File:MVSC 2010 solution.png|right]]
## Choose the <tt>"Release"</tt> build in the VS2010 "Generation" toolbar. The right menu should read Win32 for 32-bits or x64 for 64-bits. [[File:MVSC 2010 solution.png|right]]
## Generate the solution with F7 key or right-click the top level "Solution SimGear" in the Solution Explorer and choose Build.
## Generate the solution with F7 key or right-click the top level "Solution SimGear" in the Solution Explorer and choose Build.
## If there are build errors, return to CMake, clear remaining errors, [[File:CMake GUI Configure.png]] and [[File:CMake GUI Generate.png]].
## If there are build errors, return to CMake, clear remaining errors, [[File:CMake GUI Configure.png]] and [[File:CMake GUI Generate.png]].

Navigation menu