This chapter has only been tested on Linux, but it should very likely also work on Mac OS.
Using Qt Creator is not yet supported on Windows.
Please refer to the chapter about compiling from the command line:
Qt Creator can automatically fetch and compile the Scribus code from the Github mirror.
When creating the new project, just give the address:
https://github.com/scribusproject/scribus.git
or – if you've already setup the ssh authentication –:
git@github.com:scribusproject/scribus.git
Qt Creator will detect the cmake
configuration and – as long as the dependencies are met – start compiling Scribus.
If you don't have ninja
installed, by default Qt Creator compiles with only one core. If you want to improve the compilation speed, you can edit the project's configuration to ask gcc to build in parallel.
On Linux and OS X, look for the "Build" settings of the current "Project" , and ensure that in the "Build environment" you have a MAKEFLAGS
Environment variable that says -j4
.
You can change the 4
to a value gives you nice compile times, while matching the number of the cores in your computer.
Before being able to run Scribus with Qt Creator's "Run" command, you'll need to:
Once Qt Creator has built Scribus, you can run it with the "Run" command. But, before being able to run your own build of Scribus, you have to make a further step: Scribus won't find its icons unless you first install.
You can tell Qt Creator to install Scribus before running it, by adding a "Deploy Step" to the Deployment configuration of the Run settings.
In the "Add deploy step" action, pick the "Build" option and make sure that the "install" target is checked:
By default, Qt Creator installs Scribus in /usr/local
, which on most systems needs the user to be root
(In most cases, installing self compiled software outside of your own home directory is a bad idea, anyway).
You can change the target in the "Project"'s "Build and Run" configuration:
Then click the "Apply Configuration Changes" button below the list of the options.
Personally, I mostly use a bin/scribus
directory in my home, but you can also use a bin
directory in the build directory created by Qt Creator (~/src/build-scribus-qt-creator-Desktop-Default/bin
).
You can also permanently modify the path used by Qt Creator by editing the "Kit"'s defaults:
Tools > Options
, in the "Build & Run" section, pick the "Kits" tab.CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
to CMAKE_PREFIX_PATH:STRING=%{Env:<HOME>}/bin
to install into the bin
directory in your home.Next time you add a project, Qt Creator will compile in your home and not in /usr/local
.
The world has mostly settled to indenting with four or two spaces, but Scribus sticks to the policy of using tabs in the files that are not automatically generated.
In the "Projects" tool, pick the Project Settings for the _Code Style, make sure that the language is C++, and click on the "Edit..." button.
In the Code Style dialog, click on "Copy Built-in Code Style", name the new style "Scribus" and pick the Tab policy "Tabs Only".
Click on "OK" to save the new style and make sure that the Current settings is now "Scribus".
If you want to run Scribus in debug mode, you need to edit the Build edit configuration in the "Projects > Build Settings". For the "Debug" build configuration, add to the Cmake section the value:
WANT_DEBUG 1
Don't forget to apply the change with the "Apply Configuration Changes" button below the list of the options.
Warning: setting CMAKE_BUILD_TYPE=Debug
does not seem to have any effect, since the Scribus CMakeLists.txt
file probably overwrites that value.