Python 2.7 is the preferred version, but qiBuild should work fine on python 2.6, too. Note that to prepare a possible conversion to python3, python2.5 is not supported.
CMake version 2.8.3 is the preferred version, but you should not have any problem with CMake 2.6. On Windows, choose to add CMake to your %PATH%.
On windows, to use scripts written in Python, you have to put C:\Python2.x and c:\Python2.x\Scripts in your PATH.
Simply run:
./install-qibuild.sh
And make sure ~/.local/bin is in your PATH
On mac, make sure cmake is in your path.
Just run install-qibuild.bat:
c:\path\to\qibuild> install-qibuild.bat
If you have bash available on your system, and want to use qiBuild from there, you should also be able to use the .sh script. (Be careful if you are using cygwin: you must be sure the .sh has UNIX end of lines)
Plase make sure that CMake is in your PATH
If you’d like to have nice colors in your console, you can install the Python readline library: http://pypi.python.org/pypi/pyreadline
First you need to chose a qibuild “worktree”.
This path will be the root from where qiBuild searches to find the sources of your projects.
In the following document, we will use the notation QI_WORK_TREE to refer to this path.
Then go to this directory and run
$ qibuild init --interative
You will be asked to choose a CMake generator. Choose the one that matches your platform.
This will create a new qiBuild configuration file in your working directory, in QI_WORK_TREE/.qi/build.cfg
You can run qibuild config to get a look at your current settings, and change them in the file QI_WORK_TREE/.qi/build.cfg.
No specific configuration is needed, since this is the default behaviour. Enjoy!
Eclipse supports having distinct directories for the source and the build, but does not like if the later is a subdirectory of the former.
So you have to use a global build directory, by editing QI_WORK_TREE/.qi/qibuild.cfg to have
[general]
build.directory = /path/to/build/directory
cmake.generator = Eclipse CDT4 - Unix Makefiles
Your project build directory will then be /path/to/build/directory/build-<config>/<project-name>.
$ cd QI_WORK_TREE
$ qibuild configure
Then from within eclipse, go to “File -> Import” then choose “General -> General Projects into Workspace” and select your build directory as “root directory”. Let the “Copy projects into workspace” box unchecked and click “Finish”.
No specific configuration is needed, since QtCreator loads the CMakeList.txt directly. Enjoy!
Just run qibuild configure by hand first, and choose the build directory generated by qibuild when the CMake wizard asks for one.
The preferred way to use qibuild on Windows is with QtCreator, using the mingw that comes with QtCreator.
Here’s what a complete .qi/build.cfg would look like to use MinGW with QtCreator
[general]
env.path = C:\qtcreator\mingw\bin
cmake.generator = "MinGW Makefiles"
Warning
qibuild never modify os.environ globally, so the executable you just built won’t run unless you have mingw’s DLLs in your PATH.
You will have to make sure CMake uses the proper generator for qiBuild to work with Visual Studio.
Here’s what a complete .qi/build.cfg would look like to use Visual Studio 2008
[general]
cmake.generator = "Visual Studio 9 2008"
For command line addicts (or people doing continuous integration who would like a better build output), you can also:
[general]
env.bat_file = c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
cmake.generator = 'NMake Makefiles'
(the location of the .bat file depends on your setup)
You will have to do several things for qibuild to work with MinGW.
Here’s what a complete .qi/build.cfg would look like to use MinGW
[general]
env.path = C:\Mingw\bin;C:\MinGW\msys\1.0\bin;
cmake.generator = "Unix Makefiles"
Note
here you have to setup a complete msys environnement before being able to use qibuild.