Skip to content

Commit cb2c208

Browse files
committed
update fifechan build instructions and deps
1 parent d54f1d3 commit cb2c208

4 files changed

Lines changed: 153 additions & 21 deletions

developer-manual/en/chapter01-building-fifengine-on-linux.adoc

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,29 +100,71 @@ pacman -S sdl2 sdl2_ttf sdl2_image libvorbis libogg openal swig python zlib libg
100100

101101
==== Building Fifechan
102102

103-
To build Fife, you'll of course need the Fifechan source code.
104-
You can download a Fifechan source code package or fetch the latest source using git.
103+
Fifechan is a C++ GUI library that is required as an optional dependency for FIFE.
104+
You need to build it from source before building FIFE.
105+
106+
===== Install System Dependencies
107+
108+
Fifechan requires the following dependencies to be installed on your system:
109+
110+
[source,bash]
111+
----
112+
apt-get install -y \
113+
build-essential \
114+
cmake \
115+
ninja-build \
116+
freetype \
117+
libsdl2-dev \
118+
libsdl2-image-dev \
119+
libsdl2-mixer-dev \
120+
libsdl2-ttf-dev \
121+
libglew-dev \
122+
libxcursor-dev \
123+
libx11-dev \
124+
libxext-dev
125+
----
126+
127+
For testing (optional):
128+
129+
[source,bash]
130+
----
131+
apt-get install -y catch2
132+
----
133+
134+
===== Clone and Build
105135

106136
[source,bash]
107137
----
108138
git clone https://github.com/fifengine/fifechan.git && cd fifechan
109139
----
110140

141+
Create a build directory and configure with CMake using a preset or manual configuration:
142+
111143
[source,bash]
112144
----
113-
mkdir _build; cd _build; cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
145+
mkdir -p _build && cd _build
146+
cmake --preset gcc14-x64-linux-rel
147+
cmake --build --preset gcc14-x64-linux-rel
114148
----
115149

116-
Building with Clang instand of GCC Compiler:
150+
Or manually with CMake:
117151

118152
[source,bash]
119153
----
120-
mkdir _build; cd _build; cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..
154+
mkdir -p _build && cd _build
155+
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ..
156+
cmake --build .
157+
sudo cmake --install .
121158
----
122159

160+
===== Build with Clang
161+
123162
[source,bash]
124163
----
125-
make && sudo make install
164+
mkdir -p _build && cd _build
165+
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..
166+
cmake --build .
167+
sudo cmake --install .
126168
----
127169

128170
==== Building Fifengine

developer-manual/en/chapter01-building-fifengine-on-mac.adoc

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,53 @@ brew update && brew install swig sdl2 sdl2_image sdl2_ttf freetype openal-soft t
5454

5555
==== Building Fifechan
5656

57-
To build Fife, you'll of course need the Fifechan source code.
58-
You can download a Fifechan source code package or fetch the latest source using git.
57+
Fifechan is a C++ GUI library that is required as an optional dependency for FIFE.
58+
You need to build it from source before building FIFE.
59+
60+
===== Install System Dependencies
61+
62+
Install dependencies using Homebrew:
63+
64+
[source,bash]
65+
----
66+
brew install cmake ninja freetype sdl2 sdl2_image sdl2_mixer sdl2_ttf glew
67+
----
68+
69+
For testing (optional):
70+
71+
[source,bash]
72+
----
73+
brew install catch2
74+
----
75+
76+
===== Clone and Build
5977

6078
[source,bash]
6179
----
6280
git clone https://github.com/fifengine/fifechan.git && cd fifechan
6381
----
6482

83+
Create a build directory and configure with CMake using a preset or manual configuration:
84+
85+
[source,bash]
86+
----
87+
mkdir -p _build && cd _build
88+
cmake --preset clang16-x64-osx-rel
89+
cmake --build --preset clang16-x64-osx-rel
90+
----
91+
92+
Or manually with CMake:
93+
94+
[source,bash]
95+
----
96+
mkdir -p _build && cd _build
97+
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release ..
98+
cmake --build .
99+
sudo cmake --install .
100+
----
101+
git clone https://github.com/fifengine/fifechan.git && cd fifechan
102+
----
103+
65104
[source,bash]
66105
----
67106
mkdir _build; cd _build; cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..

developer-manual/en/chapter01-building-fifengine-on-windows.adoc

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The are several good IDEs available, including:
1919

2020
===== Compiler
2121

22-
You need `msvc` or `gcc`.
22+
You need `msvc` or `gcc`.
2323

2424
In case you installed MS Visual Studio, then the MSVC compiler is already installed.
2525

@@ -57,7 +57,7 @@ You have the choice of building the dependencies from source or fetching pre-bui
5757
The pre-build binaries are build on-the-fly, when building Fifengine on Appveyor.
5858
You find MSVC 14 builds here: https://ci.appveyor.com/project/LinuxDonald/fifengine
5959

60-
These builds are also included in our pre-packaged Windows development kit,
60+
These builds are also included in our pre-packaged Windows development kit,
6161
the https://ci.appveyor.com/project/LinuxDonald/fife-windows-sdk/branch/master/artifacts[Fife-SDK].
6262

6363
The default install location is `fifengine-dependencies` next to your `fifengine` source folder.
@@ -68,15 +68,15 @@ When you're using an alternative location, please set the library and include di
6868
You can build the dependencies for Windows using MSVC.
6969

7070
The CMake config file for the dependencies is `fifengine\dependencies\CMakeLists.txt`.
71-
It includes the individual scripts for fetching and building dependencies.
71+
It includes the individual scripts for fetching and building dependencies.
7272
They are located in the main CMake scripts folder: `fifengine\cmake\get-*.cmake`.
7373

7474
Let's configure the dependencies project and then build all dependencies:
7575

7676
[source,bash]
7777
----
7878
cmake dependencies -G "Visual Studio 14" -B../fifengine-dependencies/build
79-
cmake --build ../fifengine-dependencies/build --target ALL_BUILD --config Release
79+
cmake --build ../fifengine-dependencies/build --target ALL_BUILD --config Release
8080
----
8181

8282
You'll now find the dependencies the `fifengine-dependencies` folder:
@@ -86,6 +86,50 @@ You'll now find the dependencies the `fifengine-dependencies` folder:
8686
dir ..\fifengine-dependencies
8787
dir ..\fifengine-dependencies\downloads
8888
dir ..\fifengine-dependencies\includes /s
89+
90+
==== Building Fifechan
91+
92+
Fifechan is a C++ GUI library that is required as an optional dependency for FIFE.
93+
You need to build it from source before building FIFE.
94+
95+
===== Install Dependencies
96+
97+
Download and install the following dependencies:
98+
99+
* https://cmake.org/download/[CMake] - version 3.25 or higher
100+
* https://www.libsdl.org/download-2.0.php[SDL2] - Development libraries
101+
* https://www.libsdl.org/projects/SDL_image/[SDL2_image]
102+
* https://www.libsdl.org/projects/SDL_mixer/[SDL2_mixer]
103+
* https://www.libsdl.org/projects/SDL_ttf/[SDL2_ttf]
104+
* https://www.freetype.org/download.html[FreeType]
105+
* https://github.com/catchorg/Catch2/releases[catch2] (optional, for tests)
106+
107+
===== Clone and Build
108+
109+
Open the Developer Command Prompt for Visual Studio, then:
110+
111+
[source,bash]
112+
----
113+
git clone https://github.com/fifengine/fifechan.git
114+
cd fifechan
115+
mkdir _build
116+
cd _build
117+
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX=C:\fifechan ..
118+
cmake --build . --config Release
119+
cmake --install . --config Release
120+
----
121+
122+
For Debug builds, replace `Release` with `Debug`.
123+
124+
===== Using CMake Presets
125+
126+
Fifechan includes CMake presets. To use them:
127+
128+
[source,bash]
129+
----
130+
cmake --preset vc17-x64-windows-rel
131+
cmake --build --preset vc17-x64-windows-rel
132+
cmake --install --preset vc17-x64-windows-rel
89133
----
90134
91135
==== Building Fifengine

developer-manual/en/list-of-dependencies.adoc

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,34 @@ The following dependencies are needed to build FIFE from source:
4040
FifeChan is a C++ GUI library. It has several optional dependencies.
4141
The following dependencies are needed to build FifeChan from source:
4242

43+
* SDL support
44+
** http://www.libsdl.org[SDL2]
45+
** http://www.libsdl.org[SDL2_image]
46+
** http://www.libsdl.org[SDL2_mixer] **_optional_**, for FPS demo
47+
** Optional SDL Contrib Dependencies (Set `ENABLE_SDL_CONTRIB` to `ON` if you need them)
48+
*** http://www.libsdl.org[SDL2_ttf]
49+
50+
* Font rendering
51+
** https://www.freetype.org/[FreeType]
52+
4353
* OpenGL (check drivers from your graphics card vendor)
44-
** Optional OpenGL Contrib Dependencies (Set `ENABLE_OPENGL_CONTRIB` to `ON` if you need them)
45-
*** http://oglft.sourceforge.net/[OpenGL-FreeType] - optional
54+
** Optional OpenGL Contrib Dependencies (Set `ENABLE_OPENGL_CONTRIB` to `ON` if you need them)
55+
*** http://oglft.sourceforge.net/[OpenGL-FreeType] - optional
4656

47-
* SDL support
48-
** http://www.libsdl.org[SDL2]
49-
** http://www.libsdl.org[SDL2_image]
50-
** Optional SDL Contrib Dependencies (Set `ENABLE_SDL_CONTRIB` to `ON` if you need them)
51-
*** http://www.libsdl.org[SDL2_ttf]
57+
* Testing **_optional_**, set `BUILD_TESTS` to `ON` to build tests
58+
** https://github.com/catchorg/Catch2[catch2] - Unit testing framework
5259

5360
=== Atlas Creator Dependencies
5461

55-
The Atlas Creator depends on
62+
The Atlas Creator depends on
5663

5764
* Graphics/GUI libraries
5865
** http://qt-project.org/[Qt]
5966
** http://freeglut.sourceforge.net/[FreeGlut]
6067

6168
=== Checklist for new dependencies
6269

63-
In case a library gets outdated and has to be replaced or
70+
In case a library gets outdated and has to be replaced or
6471
you want to introduce a completely new 3rd party library you should ensure it meets the following guidelines:
6572

6673
- [ ] Cross-platform support (Linux, Windows, Mac)

0 commit comments

Comments
 (0)