We’ll try to compile it and by the way, understand how to make QtCreator use scons
build system instead of qmake
. Why not use qmake? SCons is implemented as a Python script and set of modules, and SCons “configuration files” are actually executed as Python scripts. This gives SCons many powerful capabilities not found in other software build tools. Here is SCons vs other build tools.
Preparation
First of all, we must install all build Mixxx dependencies (read about it here).
Keep in mind, that SCons is written to work with any Python version >= 2.4 and < 3.0. So, you must have one installed in your system.
Of course, you must have your favorite QtCreator (can get here).
Now, easiest way to get Mixxx sources is to download it (http://downloads.mixxx.org/mixxx-1.10.1/mixxx-1.10.1-src.tar.gz), but also, if you like, you can download sources from trunk, using bzr
from Launchpad:
1
|
bzr branch lp:mixxx
|
If you downloaded .tar.gz
-file, you can use the tar
command from the shell to unpack it.
1
|
tar
-xzf rebol.
tar
.gz
|
The result will be a new directory containing the files. Also, on many systems, when you download the tar.gz
from a web browser, an unpacker will open, and you can just use that.
Make QtCreator and SCons be friends
Creating project
In QtCreator you must:
- File -> New file or project -> Import Project -> Import Existing Project.
Click the Choose button. - Enter a name for the project and navigate to the source directory.
Where you unpack or get all Mixxx sources and choosemixxx/
directory. - Verify that the File selection is as you want or fine-tune it. Click the Continue button.
- Optional: choose if you want to add the files to a version control system.
- Click the “Finish” button.
After this, QtCreator will add four files to the top-level directory:
1
2
3
4
|
$PROJECT_NAME.files
$PROJECT_NAME.includes
$PROJECT_NAME.config
$PROJECT_NAME.creator
|
The most important one is $PROJECT_NAME.files
, which is just a list of all the files you want to show in the IDE. Here you can exclude unwanted files. I’ve done that this way: http://pastebin.com/EbHpi0s4.
See Setting Up a Generic Project (in QtCreator 2.5) for details.
Now you have to add the SConstruct
and SConscript
files to the IDE. Either edit by hand the $PROJECT_NAME.files
or, in the IDE project browser, right click on the top-level directory and select “Add existing files”, and then select SConstruct
from the list. Do the same for the SConscripts
.
Adding a build and a clean target
On the left pane, click “Projects”. Verify that the tab name is actually your project. Click on “Build Settings”. The “build directory” field is a bit misleading with scons. Don’t modify the default, it will use the source top-level directory. Same for the “Tool chain” pull-down menu, leave the default, it is not used by scons.
Under “Build Steps”, remove the “Make” item by hovering on “Details” and clicking the x that appears.
Click “Add Build Step”, select “Custom process step”, tick the “Enable custom process step”, under “Command” enter the full path to scons (or just “scons” if it is in your $PATH
). Leave the other fields as they are. Eventually pass a -jN
in the “Commands arguments”, where N
— is number of your real cores.
Under “Clean Steps”, do the same thing as for “Add Build Step”, only difference is that you will add “-c” to “Commands arguments”.
On the tab “Run” of “Projects” you can manually specify where will be your mixxx-build, and what executable to start (“Command”). Also, I recommend add next text if “Argument field”: --resourcePath res/
(as described here http://mixxx.org/wiki/doku.php/compiling_on_linux)
P.S. Got here http://www.scons.org/wiki/IDEIntegration#Qt_Creator