fpc fpmake.pp ./fpmake --globalunitdir=xxx ./fpmake install --globalunitdir=xxx --prefix=xxx --baseinstalldir=xxx
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.
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
.
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.
|
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
.
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:
https://github.com/castle-engine/castle-engine/blob/master/examples/instantfpc/instant_fpc_test_list_pascal_files - list Pascal files in the current directory, using CastleFindFiles
https://github.com/castle-engine/castle-engine/blob/master/examples/instantfpc/instant_fpc_test_open_window - open a window, with text taken from the 1st command-line parameter, using TCastleWindow
and TCastleLabel
.
To improve this documentation just edit this page and create a pull request to cge-www repository.
Copyright Michalis Kamburelis and Castle Game Engine Contributors.
This webpage is also open-source and we welcome pull requests to improve it.
We use cookies for analytics. See our privacy policy.