Latest Posts

Changes in WidelandsGoingCMake

Editor Comment

Different attempt for the out-of-source build: only one subdir


Revision Differences of Revision 6

# Widelands going CMake ¶

Widelands project plans to move from the current build system SCons to CMake. ¶

This page is to track progress and collect important information in the transition process. ¶

## Table of Contents: ¶
[TOC] ¶



## Important Links ¶

* [SCons](http://www.scons.org) ¶
* [CMake](http://www.cmake.org) ¶
* [CMake Tutorial \(PDF\]](http://www-flc.desy.de/ldcoptimization/documents/talks/CMake_Tutorial.pdf) ¶

## Identified Tasks ¶
### Changes to do Build ¶
* *make install* does not exclude SVN directories ¶
* add "PATTERN "\*.svn\*" EXCLUDE" to global CMakeLists.txt file *INSTALL* directive ¶
* *make install* includes the *doc* directory which is not necessary for release, but maybe interesting for debug ¶
### Transition tasks ¶
* CMake's "make install" installs in /usr/local - needs root. Just "make" creates the executables but does not lay out a usable installation of widelands. The "make" should create a runnable widelands installation in a subdirectory of the build directory, since we don't need root to run widelands. Then "make install" could just copy the files to /usr/local. Discuss? ¶
* CMake currently always creates a Debug build (at least it seems so). It should be possible to build a Release. ¶
* Identify SCons tasks and targets used by widelands, replace using cmake & make ¶

## Important notes ¶
### Things to know about the transition ¶
* Transition uses a SVN branch called "cmake-transition", not "trunk" ¶

### Starting with CMake in the transition (this is for Linux; Windows will differ) ¶
####
1. Preparation ¶
* $
mkdir ~/wl_cmake_transition ¶
* $
cd ~/wl_cmake_transition
* $ svn co https://widelands.svn.sourceforge.net/svnroot/widelands/branches/cmake-migration widelands-cmake ¶
* $ mkdir widelands-
cmake/build-cmake

####
2. Using CMake ¶
* $ cd ~/w
idel_ands-cmake_trans/build-cmake ¶
* go
tion/w the build directory ¶
* $ cmake .. ¶
*
let CMands-buke create the Makefildes
* $ cmake -DCMAKE_INSTALL_PREFIX=~/w
idel_ands-cmake_tra-insitall .. ¶
*
if you wan/wit to have a different install directory for "make inds-tall" instead of /usr/local

#### 3
.. Using make ¶
* $ cd ~
/widelands-cmake/build-cmake
* $go makto the buinsld directory ¶
* $ m
allke -j3
&& cd .. *&& ./build-cmake /src/widelands
*
talhis runs Wideland in the source directory using the freshly budilt binaries
* $
make; install -j3
*makea ins usetall 3 coinclurrdents compile taskse!