OFGame Compiling Linux/CMake
From OpenFrag
Contents |
CMake
As well as the autotools buildsystem currently available, OpenFrag also has a CMake buildsystem. Among the advantages of CMake are that it provides excellent cross-platform support, that it can create project files for various IDEs such as KDevelop, XCode and MS Visual Studio and that it builds out-of-source, keeping the source tree clean of temporary files.
Building
Building OpenFrag with CMake is easy, all the requirements are the same as for building with automake except you will require CMake 2.4.7 or greater which most distributions will have available as a package. From the base directory (that is, the one containing src, scripts, include etc.), do:
mkdir build && cd build cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/openfrag-install make install
This will build and install OpenFrag to a directory in your home directory folder. The openfrag executable will be put in $HOME/openfrag-install/games. If you omit the -DCMAKE_INSTALL_PREFIX part, it will default to installing to /usr/local in Linux.
If CMake fails to find any of the dependencies but you know you have the development headers/libraries installed, add -DLIBRARY_SEARCH_DIRS=<path/to/lib> and -DINCLUDE_SEARCH_DIRS=<path/to/include> to the cmake command.
IDE project files
If you want to create a project file for your IDE (e.g. KDevelop), add -GKDevelop3 to the cmake command above. This will create a .kdevelop file in the build directory which can be opened by KDevelop.
If you need help...
If you have any problems with compiling with CMake, just poke milliams in the IRC channel.

