Compiling and Installing Using CMake and Scribus 1.4.x

After many years of using the autotools build system, the developers of Scribus have selected CMake as a replacement system. It provides a much more flexible setup with a lot less complexity. It also provides compatibility with build tools on Linux and variants of UNIX, Windows and Mac OS X.

To build with the CMake build system, you will of course need CMake itself. Most Linux and some UNIX distributions provide it as a standard package. If not, please download it, and make sure you get a recent version, like 2.8 or higher. Mac OS X users can also find installers there, or get it from macports.org. Scribus does not yet use CMake for Windows, although this may be added in the future.

One of the advantages of CMake is that we can build “out of source.” By creating a separate directory where the program is being being compiled, the temporary files and resulting application files are not stored in the same location as the Scribus source files. This helps keep directory structures clean and will also reduce the download time for updating your source tree a little. This is the preferred method and strongly recommended by our developers. CMake is also much simpler to maintain for developers and errors can be understood by mere mortals.

Preparation

Let's assume the following:

Starting an Out-of-Source Build

Change to the source directory:

cd /home/username/scribussource/

Make a directory to build Scribus in:

mkdir builddir

Change to the build directory:

cd builddir

Then run:

/usr/bin/cmake ../Scribus -DCMAKE_INSTALL_PREFIX:PATH=/home/username/scribusinstall/

If this is the build location you have chosen, please skip down to the Build Stage section

Continuing onto the Build Stage

Once the CMake command you have chosen above has completed successfully (remember it needs to find the dependencies of Scribus and record their locations), then you need to run:

make && make install

Advanced Options

Build Options

Some options that the Scribus 1.4.x CMake files know about (more to come!):

Например: To make a Cairo debug build, then something like this should be used (all in one line):

/usr/bin/cmake . -DCMAKE_INSTALL_PREFIX:PATH=/home/username/scribusinstall -DWANT_DEBUG=1 -DWANT_VERSIONING=1

Specifying Library Locations

Whenever your distribution releases their package for a library that Scribus depends on, it may still not be the very latest stable or unstable version from the authors of the library. In some cases, the Scribus developers have had to rely on the very latest code to improve some parts of Scribus. In this case it is necessary to build your own version of such a library.

Creating a Tarball for Distribution

To create a tarball for distribution, the old way would be to make dist.

The new way is to run:

make package_source

or

/usr/bin/cpack -G TBZ2 --config CPackSourceConfig.cmake

to give you a bundle of the source.

Важно: If you need to re-run cpack remove the _CPack_Packages/ before running this a second time.

You can also use svn export

/path/to/scribus/svn
in a temporary directory and then tar or zip the directory to create a tarball.

Troubleshooting and Success Stories

If after reading these instructions through and you still have issues, please join us on IRC or post an email to our mailing list with specifics of your problem. We are also interested in hearing from people who have successfully compiled Scribus on non-Linux platforms. We already know that it’s very reliable on Mac OS X.