FpMake and FpPkg

1. Introduction

You can compile and install Castle Game Engine units using FPC fpmake / fppkg.

Note that most users are probably more interested in compiling using CGE editor or build tool, or using Lazarus. However, the compilation and installation using fpmake / fppkg is also fully supported.

2. Using FpMake

In short: use the fpmake.pp file in CGE top-level directory, and follow standard FpMake and fppkg docs.

Using pure fpmake, this looks like this:

fpc fpmake.pp
./fpmake --globalunitdir=xxx
./fpmake install --globalunitdir=xxx --prefix=xxx --baseinstalldir=xxx

Instead of doing install command, you could also manually modify your fpc.cfg file to add the necessary unit path, like -FuXxx/castle_game_engine/units/x86_64-linux.

3. Using FpPkg

Simply doing

fppkg install

in the main CGE directory should work.

Note
if it fails with Access Violation (as it happens with FPC 3.3.1-r41725 on Win64 now) then use the fpmake approach instead, see above.

4. Compiling your applications

Since the CGE units are now compiled to a directory listed in fpc.cfg file, you can just compile your applications from the command-line by fpc my_application.lpr.

5. Compiling and running your applications with InstantFPC

Once you installed CGE units this way, you can use InstantFPC without any additional configuration. That is, you can use CGE units inside program files processed by InstantFPC.

InstantFPC allows to use Pascal programs like scripts. You do not explicitly invoke compilation. Instead you run the Pascal source code and (thanks to Unix shebang) it is automatically recompiled and run under the hood. The scripts developed this way work on Unix or Windows (with Cygwin).

See the InstantFPC for more information.

Examples:


To improve this documentation just edit this page and create a pull request to cge-www repository.