]> git.mxchange.org Git - flightgear.git/blob - README.msvc
Remove a duplicate line.
[flightgear.git] / README.msvc
1 WINDOWS / VISUAL STUDIO BUILD INSTRUCTIONS
2 ==========================================
3
4 [For Linux/Unix/OSX/... instructions see README.cmake]
5
6
7 Directory Structure
8 ===================
9
10 On Windows, assumptions on the directory structure are made to automate
11 the discovery of dependencies.
12 This recommended directory structure is described below:
13
14 ${MSVC_3RDPARTY_ROOT} /
15       3rdParty /                 ( includes plib, fltk, zlib, libpng,
16                                    libjpeg, libtiff, freetype, libsvn,
17                                    gdal, ... )
18          bin /
19          include /
20          lib /
21       3rdParty.x64 /             ( 64 bit version )
22          ...
23       boost_1_44_0 /
24          boost /
25       install /
26          msvc100 /               ( for VS2010 32 bits, or msvc90,
27                                    msvc90-64 or msvc100-64 for VS2008 32,
28                                    VS2008 64 and VS2010 64 )
29             OpenSceneGraph /     ( OSG CMake install )
30                bin /
31                include /
32                lib /
33             SimGear /
34                include /
35                lib /
36
37 If you do not use the recommended structure you will need to enter paths
38 by hand. Source and build directories can be located anywhere.
39
40
41 Running CMake GUI
42 =================
43
44 The suggested inputs to cmake are :
45   MSVC_3RDPARTY_ROOT : location of the above directory structure
46   CMAKE_INSTALL_PREFIX : ${MSVC_3RDPARTY_ROOT}/install/msvc100/FlightGear
47      (or any variation for the compiler version described above)
48
49 1. Set up a work directory as described above.
50
51 2. Open the CMake gui.
52
53 3. Set "Where is the source code" to wherever you put the FlightGear
54    sources (from the released tarball or the git repository).
55
56 4. Set "Where to build the binaries" to an empty directory.
57
58 5. Press the "Configure" button. The first time that the project is
59    configured, CMake will bring up a window asking which compiler you wish
60    to use. Normally just accept Cmakes suggestion, and press Finish. CMake
61    will now do a check on your system and will produce a preliminary build
62    configuration.
63
64 6. CMake adds new configuration variables in red. Some have a value ending
65    with -NOTFOUND. These variables should receive your attention. Some
66    errors will prevent FlightGear to build and others will simply
67    invalidate some options without provoking build errors. First check the
68    MSVC_3RDPARTY_ROOT variable. If it is not set, chances are that there
69    will be a lot of -NOTFOUND errors. Instead of trying to fix every error
70    individually, set that variable and press the "Configure" button again.
71
72 7. Also check the lines with a checkbox. These are build options and may
73    impact the feature set of the built program.
74
75 8. Change the CMAKE_INSTALL_PREFIX to
76    ${MSVC_3RDPARTY_ROOT}/install/msvc100/FlightGear because
77    C:\Program Files is likely unwritable to ordinary Windows users and
78    will integrate better with the above directory structure (this is
79    mandatory for SimGear if you don't want to solve errors by hand).
80
81 10. Repeat the process until the "Generate" button is enabled.
82
83 11. Press the "Generate" button.
84
85 12. Start Visual Studio 2010 and load the FlightGear solution
86     (FlightGear.sln) located in "Where to build the binaries" (point 4.)
87
88 13. Choose the "Release" build in the VS2010 "Generation" toolbar
89
90 14. Generate the solution.
91
92 15. If there are build errors, return to CMake, clear remaining errors,
93     "Configure" and "Generate"
94
95 16. When Visual Studio is able to build everything without errors, build
96     the INSTALL project to put the product files in ${CMAKE_INSTALL_PREFIX}
97
98 17. Enjoy!
99
100
101 Rebuilding Updated Sources
102 ==========================
103
104 When updating the sources from Git, it is usually unnecessary to restart
105 CMake as the solution is able to reconfigure itself when CMake files are
106 changed. Simply rebuild the solution from Visual Studio and accept the
107 reload of updated projects. It also possible to edit CMakeList.txt files
108 directly in Visual Studio as they also appear in the solution, and projects
109 will be reconfigured on the next generation. To change build options or
110 directory path, it is mandatory to use the CMake Gui. In case of problems,
111 locate the CMakeCache.txt in "Where to build the binaries" directory and
112 delete it to reconfigure from scratch or use the menu item
113 File->Delete Cache.
114