]> git.donarmstrong.com Git - flightcrew.git/blob - INSTALL.txt
debian/control: let libflightcrew-dev be arch:all and depends on libflightcrew0
[flightcrew.git] / INSTALL.txt
1 ***************************************************************\r
2 The latest version of this document is always available here:\r
3     http://code.google.com/p/flightcrew/wiki/BuildingFromSource\r
4 ****************************************************************\r
5  = General notes = \r
6 \r
7 You will need CMake 2.8.0 or later on all platforms. You can download it \r
8 [http://www.cmake.org/cmake/resources/software.html here]. CMake is a \r
9 cross-platform system for build automation. It can generate Visual \r
10 Studio project files on Windows, Xcode project files on Mac OS X and \r
11 Makefiles on Unix systems. After installing CMake, you can see a list of \r
12 generators provided on your system by typing `cmake` in your terminal \r
13 and pressing enter. The supported generators should be listed near the \r
14 bottom of the printout. \r
15 \r
16 To build FlightCrew-gui, Qt 4.6.x is also required on all platforms. It \r
17 can be downloaded [http://qt.nokia.com/downloads here] (choose the LGPL \r
18 version). *Qt is not necessary for the core FlightCrew library and \r
19 FlightCrew-cli.* \r
20 \r
21 Mac users should grab the Qt SDK. Windows users can also download the \r
22 SDK which comes with MinGW and the Qt Creator IDE. If you want to use \r
23 the Visual Studio compiler, you should download the precompiled Qt \r
24 libraries for Visual Studio 2008 from Nokia's website. Linux users \r
25 should get it from their distribution's package manager (more \r
26 information in the Linux section). \r
27 \r
28 On some platforms a `makeinstaller` target is provided for \r
29 FlightCrew-gui which will build a binary installer. For that to work, \r
30 you need to have InstallJammer installed and on the system PATH. You can \r
31 get InstallJammer [http://www.installjammer.com/ here]. You need to have \r
32 the Qt libraries on the system PATH as well. \r
33 \r
34 == Running the test suite == \r
35 \r
36 FlightCrew comes with an extensive test suite that should cover _all_ of \r
37 the checks it performs, minus the ones coming from schemas. The default \r
38 build procedure will build the `fc_tests` application that runs the \r
39 tests. *You have to run `fc_tests` from the "bin" folder.* The \r
40 application expects a `test_data` folder in the current working \r
41 directory, so running it from any other directory will usually fail. \r
42 \r
43 Note that I said that `test_data` is expected in "the current working \r
44 directory", *not* the directory in which `fc_tests` is located. The two \r
45 can be the same, but they can also be different. \r
46 \r
47 == Compiling on Windows == \r
48 \r
49 It is assumed you want to generate Visual Studio project files. You can \r
50 do this by creating a new folder *outside* of the source distribution. \r
51 \r
52 Now navigate to that folder with a terminal like cmd.exe or PowerShell. \r
53 Then type in and run the following: \r
54 \r
55 cmake -G "Visual Studio 9 2008" /path/to/extracted/folder \r
56 \r
57 This should create SLN and vcproj files for Visual Studio in that \r
58 directory. You can also generate project files for some other VS \r
59 version. You can get a list of all supported generators by typing in\r
60 and running `cmake`. \r
61 \r
62 The default build procedure will build `FlightCrew-gui.exe` and \r
63 `FlightCrew-cli.exe`; if you want to package that with the required \r
64 DLL's into an installer, build the `makeinstaller` project. \r
65 \r
66 There is also an \r
67 [http://www.qtsoftware.com/downloads/visual-studio-add-in add-in] for VS \r
68 on Qt's website. It will make it easier to develop Qt applications like \r
69 FlightCrew-gui, but is not strictly necessary. \r
70 \r
71 *NOTE:* If you generate solution files for VS 2010 with CMake version\r
72 <= 2.8.1, those builds will fail. This is caused by \r
73 [http://www.cmake.org/Bug/view.php?id=10503 a bug] in CMake. This bug \r
74 has been fixed and CMake 2.8.2 and above don't have this problem. \r
75 \r
76 == Compiling on Mac == \r
77 \r
78 It is assumed you want to generate Xcode project files. You can do this \r
79 by creating a new folder *outside* of the source distribution. \r
80 \r
81 Now navigate to that folder with the Terminal. Then type in and run the \r
82 following: \r
83 \r
84 cmake -G Xcode /path/to/extracted/folder \r
85 \r
86 This should create Xcode project files in that directory. The default\r
87 build procedure will build `FlightCrew-gui.app` and `FlightCrew-cli`;\r
88 if you want to package `FlightCrew-gui.app` into a DMG file, invoke the \r
89 `makedmg` build target. \r
90 \r
91 == Compiling on Linux == \r
92 \r
93 If you want to build FlightCrew-gui you will need the core Qt libraries \r
94 and *libqt4-dev*. \r
95 \r
96 This should be as simple as typing in the following command into your \r
97 terminal (on Debian-like systems): \r
98 \r
99 sudo apt-get install libqt4-gui libqt4-dev \r
100 \r
101 It is assumed you want to generate Makefiles. You can do this by \r
102 creating a new folder *outside* of the source distribution. \r
103 \r
104 Now navigate to that folder with a terminal. Then type in and run the \r
105 following: \r
106 \r
107 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release /path/to/extracted/folder \r
108 make\r
109 sudo make install \r
110 \r
111 That builds and installs FlightCrew-cli and FlightCrew-gui on Linux. \r
112 By default, they are installed in `${CMAKE_INSTALL_PREFIX}/bin`, with \r
113 `CMAKE_INSTALL_PREFIX` defaulting to `usr/local`. \r
114 \r
115 You can change the install location by running cmake like this:\r
116 \r
117 cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/new/install/prefix -DCMAKE_BUILD_TYPE=Release /path/to/extracted/folder\r
118 \r
119 Aside from using the install target, you can also build a binary installer \r
120 by invoking the `makeinstaller` build target. \r
121 \r
122 Building from source in the repository is recommended, since code in \r
123 the repository should always be stable. If it's not, that's a bug report. \r
124 \r
125 == Building FlightCrew as a DLL == \r
126 \r
127 *By default, FlightCrew is configured to build as a static library.* To \r
128 compile it as a DLL, you need to do two things: \r
129 \r
130 * Pass `-DBUILD_SHARED_FC=1` to the cmake call. So for Visual Studio \r
131   2008, it would look something like this: \r
132 \r
133   cmake -G "Visual Studio 9 2008" -DBUILD_SHARED_FC=1 /path/to/extracted/folder \r
134  \r
135 * Define `FC_BUILT_AS_DLL` when including `flightcrew.h` \r
136 \r
137 == Not building FlightCrew-gui ==\r
138 \r
139 Just pass `-DSKIP_FC_GUI=1` to the cmake call. This can be passed along \r
140 with the option to build FlightCrew as a DLL.\r
141 \r
142 == Not building the test executable ==\r
143 \r
144 The default build procedure will also build a `fc_test` executable in the\r
145 `bin` directory of your build folder. Running this program runs the \r
146 FlightCrew test suite.\r
147 \r
148 You can disable the building of this application by passing \r
149 `-DNO_TEST_EXE=1` to the cmake call. This can also be combined with the \r
150 other build options.\r
151 \r
152 It is *highly* recommended to build and run the test application on your \r
153 system.\r
154 \r
155 = Compiling Qt = \r
156 \r
157 Compiling Qt directly should not be necessary. Nevertheless, if you wish \r
158 to compile Qt, you should configure it before compiling like this:\r
159 \r
160 configure -opensource -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg \r
161 \r
162 These are the options used to configure the Qt libraries that are\r
163 provided with FlightCrew-gui on Windows. \r
164 \r
165 Building Qt takes many hours. You can save yourself a lot of time by \r
166 passing `-nomake tools -nomake examples -nomake demos -nomake docs \r
167 -nomake translations` to `configure` as well. For Visual Studio builds, \r
168 passing `-ltcg` is also strongly recommended. \r
169 \r