8,807
edits
m (→Building: add MVSC screenshot) |
(Note about steps, fix link, add building template.) |
||
Line 8: | Line 8: | ||
== 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. | |||
<tt> | <tt> | ||
: ${MSVC_3RDPARTY_ROOT} / | : ${MSVC_3RDPARTY_ROOT} / | ||
:: [ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/ | :: [ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/MSVC/ 3rdParty] / </tt> ( includes plib, fltk, zlib, libpng, libjpeg, libtiff, freetype, libsvn, gdal, ... ) <tt> | ||
::: bin / | ::: bin / | ||
::: include / | ::: include / | ||
Line 40: | Line 40: | ||
== Building == | == Building == | ||
# Set up a work directory as described above. | # Set up a work directory as described above. | ||
# Open the | # Open the CMake gui. | ||
# '''The following steps depend on the part you would like to build.''' The here mentioned steps are for FlightGear, but SimGear and TerraGear can be built via the same method (just remember to change the paths). | |||
# Set <tt>"Where is the source code"</tt> to wherever you put the FlightGear sources (from the released tarball or the git repository). | # Set <tt>"Where is the source code"</tt> to wherever you put the FlightGear sources (from the released tarball or the git repository). | ||
# Set <tt>"Where to build the binaries"</tt> to an empty directory. | # Set <tt>"Where to build the binaries"</tt> to an empty directory. | ||
# Press the <tt>"Configure"</tt> button. The first time that the project is configured, | # Press the <tt>"Configure"</tt> button. The first time that the project is configured, CMake will bring up a window asking which compiler you wish to use. Normally just accept CMakes suggestion, 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 FlightGear to build and others will simply invalidate some options without provoking 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 and press the <tt>"Configure"</tt> button again. | ||
# Also check the lines with a checkbox. These are build options and may impact the feature set of the built program. | # Also check the lines with a checkbox. These are build options and may impact the feature set of the built program. | ||
# Change the <tt>CMAKE_INSTALL_PREFIX</tt> to <tt>${MSVC_3RDPARTY_ROOT}/install/msvc100/FlightGear</tt> because <tt>C:\Program Files</tt> is likely unwritable to ordinary Windows users and will integrate better with the above directory structure (this is mandatory for SimGear if you don't want to solve errors by hand). | # Change the <tt>CMAKE_INSTALL_PREFIX</tt> to <tt>${MSVC_3RDPARTY_ROOT}/install/msvc100/FlightGear</tt> because <tt>C:\Program Files</tt> is likely unwritable to ordinary Windows users and will integrate better with the above directory structure (this is mandatory for SimGear if you don't want to solve errors by hand). | ||
Line 52: | Line 53: | ||
# 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[[File:MVSC 2010 solution.png|right]] | ||
# Generate the solution. | # Generate the solution. | ||
# If there are build errors, return to | # If there are build errors, return to CMake, clear remaining errors, <tt>"Configure"</tt> and <tt>"Generate"</tt> | ||
# When Visual Studio is able to build everything without errors, build the <tt>INSTALL</tt> project to put the product files in <tt>${CMAKE_INSTALL_PREFIX}</tt> | # When Visual Studio is able to build everything without errors, build the <tt>INSTALL</tt> project to put the product files in <tt>${CMAKE_INSTALL_PREFIX}</tt> | ||
# Enjoy! | # Enjoy! | ||
PS: When updating the source from git, it is usually unnecessary to restart | PS: When updating the source from git, it is usually unnecessary to restart CMake as the solution is able to reconfigure itself when CMake files are changed. Simply rebuild the solution from Visual Studio and accept the reload of updated projects. It is also possible to edit CMakeList.txt files directly in Visual Studio as they also appear in the solution, and projects will be reconfigured on the next generation. To change build options or directory path, it is mandatory to use the CMake Gui. In case of problems, locate the <tt>CMakeCache.txt</tt> file in <tt>"Where to build the binaries”</tt> directory and delete it to reconfigure from scratch or use the menu item File->Delete Cache. | ||
== Jenkins Windows configurations == | == Jenkins Windows configurations == | ||
Line 68: | Line 69: | ||
-DGDAL_INCLUDE_DIR:PATH= | -DGDAL_INCLUDE_DIR:PATH= | ||
-DGDAL_LIBRARY:FILEPATH= | -DGDAL_LIBRARY:FILEPATH= | ||
=== SimGear-Win- | === SimGear-Win-CMake === | ||
cmake ..\SimGear -G "Visual Studio 10" | cmake ..\SimGear -G "Visual Studio 10" | ||
-DMSVC_3RDPARTY_ROOT=%WORKSPACE% | -DMSVC_3RDPARTY_ROOT=%WORKSPACE% | ||
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc100/SimGear | -DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc100/SimGear | ||
=== FlightGear-Win- | === FlightGear-Win-CMake === | ||
cmake ..\FlightGear -G "Visual Studio 10" | cmake ..\FlightGear -G "Visual Studio 10" | ||
-DMSVC_3RDPARTY_ROOT=%WORKSPACE% | -DMSVC_3RDPARTY_ROOT=%WORKSPACE% | ||
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc100/FlightGear | -DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc100/FlightGear | ||
-DFLTK_FLUID_EXECUTABLE=%WORKSPACE%/3rdParty/bin/fluid.exe | -DFLTK_FLUID_EXECUTABLE=%WORKSPACE%/3rdParty/bin/fluid.exe | ||
=== FGRun-Win- | === FGRun-Win-CMake === | ||
cmake ..\svn -G "Visual Studio 10" | cmake ..\svn -G "Visual Studio 10" | ||
-DMSVC_3RDPARTY_ROOT:PATH=%WORKSPACE% | -DMSVC_3RDPARTY_ROOT:PATH=%WORKSPACE% | ||
Line 84: | Line 85: | ||
-DGETTEXT_MSGFMT_EXECUTABLE:FILEPATH=%WORKSPACE%/3rdParty/bin/msgfmt.exe | -DGETTEXT_MSGFMT_EXECUTABLE:FILEPATH=%WORKSPACE%/3rdParty/bin/msgfmt.exe | ||
-DGETTEXT_MSGMERGE_EXECUTABLE:FILEPATH=%WORKSPACE%/3rdParty/bin/msgmerge.exe | -DGETTEXT_MSGMERGE_EXECUTABLE:FILEPATH=%WORKSPACE%/3rdParty/bin/msgmerge.exe | ||
=== TerraGear-Win- | === TerraGear-Win-CMake === | ||
cmake ..\TerraGear -G "Visual Studio 10" | cmake ..\TerraGear -G "Visual Studio 10" | ||
-DMSVC_3RDPARTY_ROOT=%WORKSPACE% | -DMSVC_3RDPARTY_ROOT=%WORKSPACE% | ||
Line 91: | Line 92: | ||
-DNEWMAT_LIBRARY=%WORKSPACE%/3rdParty/lib/newmat11.lib | -DNEWMAT_LIBRARY=%WORKSPACE%/3rdParty/lib/newmat11.lib | ||
== External | == External link == | ||
* [https://gitorious.org/fg/flightgear/blobs/next/docs-mini/README.MSVC README.MSVC] (at Gitorious) | * [https://gitorious.org/fg/flightgear/blobs/next/docs-mini/README.MSVC README.MSVC] (at Gitorious) | ||
{{building}} |