CMake

From The Battle for Wesnoth Wiki

[edit]Compiling Wesnoth

Platforms
Tools

CMake

From Wikipedia:

CMake is a unified, cross-platform, open-source build system that enables developers to build, test and package software by specifying build parameters in simple, portable text files. It works in a compiler-independent manner and the build process works in conjunction with native build environments, such as make, Apple's Xcode and Microsoft Visual Studio. It also has minimal dependencies, C++ only.

Customizing

There are two common ways to customize your cmake build: cmake -i (a question-answer based interface) and ccmake (curses interface). Pick the one that suits your needs.

Useful options

Keep in mind that to change value of an option marked as (advanced) you need to explicitly enable showing advanced options in your cmake interface.

  • CMAKE_CXX_COMPILER (advanced) - allows for changing the used compiler. Handy for enabling ccache, it can be done by setting this variable to e.g. /usr/lib/ccache/bin/c++ (depends on place of your ccache installation)
  • ENABLE_DESIGN_DOCUMENTS - controls compilation of design documents from doc/design/. Currently there is not a lot of them, but if you are going to work on a area that's documented, it's a good read nonetheless.
  • ENABLE_NLS - controls compilation of NLS (Native Language Support). It's quite useful to disable it if you only use the default (US English) l10n of Wesnoth, since building of all the .po files takes some time.
  • ENABLE_TEST - controls compilation of unit tests, stored in src/tests/. It's always a good idea to write unit tests for your code and this option enables

Links

This page was last modified on 8 June 2011, at 21:45.