Using FpMake / FpPkg with Castle Game Engine
You can compile and install Castle Game Engine units using FPC
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
fppkg is also fully supported.
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
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.
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
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.
https://github.com/castle-engine/castle-engine/blob/master/examples/simple_command_line_utilities/instant_fpc_test_list_pascal_files - list Pascal files in the current directory, using
https://github.com/castle-engine/castle-engine/blob/master/examples/simple_command_line_utilities/instant_fpc_test_open_window - open a window, with text taken from the 1st command-line parameter, using