The Boost.Build (long name: Boost.Build Project Manager) plugin provides basic Boost.Build support for Qt Creator.
Project at https://github.com/mloskot/qt-creator-plugin-boostbuild.
The idea of the Boost.Build plugin is extremely simple - use Qt Creator as a basic GUI shell to interact with the Boost.Build command.
Three main features:
Think of the plugin as an equivalent of Vim or Emacs with ctags and bunch of other scripts.
It turns out, that in order to achieve the three basic features above, a project manager plugin for Qt Creator needs to implement a few beefy features like: opening a project, reading project directory structure, creating nodes of project explorer tree, creating build, run, deploy configurations and corresponding build, run, deploy steps and more.
So, the Boost.Build plugin implements as little as necessary, and currently, it does not provide:
lots of thanks to!
What the Boost.Build plugin can do?
b2
from within Qt Creator.b2
is executed.b2
option --build-dir
..user
..qtcreator.files
..qtcreator.includes
..What the Boost.Build plugin can not do?
You need to build the plugin from sources.
Generally, follow the Getting and Building Qt Creator section from the Creating Plugins guide.
I use Qt and Qt Creator built from sources in their Git repositories, for example:
So, I recommend to follow these guides:
Once you have Qt Creator build ready, you need to set two environment variables:
QTC_SOURCE
- Qt Creator sources location (e.g. path to Git clone)QTC_BUILD
- Qt Creator build or install prefix where the plugin will be deployedYou can either set the variables in CLI console, if you're going to run qmake
directly or in Qt Creator, in
Build Environment
settings of the boostbuildprojectmanager.pro
project, after you open it in the IDE
in order to build the plugin from Qt Creator.
b2
command working directory, that is where the command is executedb2
as value of --build-dir
optionb2
command (e.g. change toolset, build variant).qtcreator.files
to add or remove source files and edit
.qtcreator.includes
to specify include paths if C++ model is missing any.For more details about individual features, steps and settings check the FAQ.
I always wanted to learn Qt programming.
When my son Hugo was born, I went on two weeks paternity leave and, somewhat inspired by the Seven by Seven idea, I decided to do an experiment: can I learn a new programming skills or work on an open source project having only a few 15-30 minutes short breaks over a day at my disposal?
Qt Creator is a fantastic and powerful IDE which is surprisingly easy and pleasent to extend.
Yet, apparently, it is much quicker to hack fairly usable Boost.Build support for Qt Creator than develop Boost.CMake and wait until it is approved by the Boost project.
No.
No demand, no man power, no plans.
UPDATE: There was an attempt to prepare contribution of this plug-in for to Qt Creator, but it failed. See the Issue #13 for details.
The Boost.Build plugin is inspired and largely based on the Generic Project plugin (aka GenericProjectManager), both idea and implementation.
The Boost.Build plugin is a hybrid between "Open Project" and "Import Project" plugin.
Similarly to Generic Project support, the Boost.Build plugin:
.files
and .includes
kinds of auxiliary filesUnlike Generic Project support, the Boost.Build plugin:
b2
command,b2
working directory which can be different
from both, build directory and project directory, where project directory means
directory with Jamfile selected to open as a project.Finally, the Boost.Build plugin is a pilot project integrating Boost.Build system with an IDE and this experience may be useful for future improvements and development of Boost.Build system itself.
I use Qt Creator 3.3, but it should work with Qt Creator 3.0 or later. There are git tags corresponding to Qt Creator versions.
See also the Installation section.
Build it.
I don't know. Ask Qt folks.
I follow their Getting and Building Qt Creator:
Qt Creator requires private headers of Qt, which are unfortunately not installed by the Qt binary packages
Apparently, yes, as per Getting and Building Qt Creator:
It is also necessary if you want to create your own Qt Creator plugin.
No.
No.
Jamfile is a makefile of Boost.Build written in dedicated
Boost.Jam language
and interpreted by Boost.Build engine which is executed and controlled by
Boost.Build command b2
.
See Boost.Build Overview
for more details.
Boost.Build convention is that the top of
project hierarchy
is called project root where lives a Jamfile called Jamroot
.
A project may define subprojects and each subproject is defined by a Jamfile
called Jamfile
in a descendant directory of the project root.
For both, root and subproject Jamfiles, Boost.Build recognises variety of file names:
[Jj]amroot
as well as [Jj]amroot.jam
and project-root.jam
[Jj]amfile
as well as [Jj]amfile.jam
, [Jj]amfile.v2" and
[Bb]uild.jam```.Most of those names are recognised by the Boost.Build Project Manager plugin.
*.qtcreator.files
file for?Qt Creator, the Boost.Build plugin, for a Jamfile which is opened as a project,
automatically generates .qtcreator.files
file with list of all files selected
in the Files Selection page of the project wizard.
Role of this file is exactly the same as role of .files
file for the
Generic Project.
It just uses different extension to clearly indicate its role and avoid file name clashes.
To add or remove files, edit the .qtcreator.files
file in Qt Creator.
(TODO: Qt Creator recreates your project tree when you save the .files file.)
*.qtcreator.includes
file for?Qt Creator, the Boost.Build plugin, for a Jamfile which is opened as a project,
automatically generates .qtcreator.includes
file.
This file is dedicated to specify any include paths which are solely used by Qt Creator for analysing C/C++ code of the project. Note, these include paths do not affect compilation of source files whatsoever as Jamfile files remain the only source of build configuration.
The project wizard generates initial list of include paths adding every directory of project which contains C/C++ header files. For large projects, like Boost, this may generate long list of includes paths, though it should be easy to filter it.
To add or remove include paths, edit the .qtcreator.includes
file in Qt Creator.
The paths can be either absolute or relative to the .qtcreator.includes
file.
*.user
file for?This file is natively created by Qt Creator when Opening Projects:
Qt Creator stores information that it needs to build projects in a .user file.
The Boost.Build Project Manager also uses this file to store information specific to corresponding Jamfile project, like:
b2
b2
option --build-dir
The Open Boost.Build Project wizard suggests project name on its first page titled Project Name and Paths.
The wizard tries to extract project name from the Boost.Build project rule, if present in the Jamfile being opened. Otherwise, the wizard uses name of parent directory of the Jamfile. Finally, user can change the Project name freely as it is only used by Qt Creator, not by Boost.Build configuration.
The idea is to provide certain degree of freedom in arranging Jamfile-based projects in Qt Creator session, regardless of their arrangements on disk.
This feature, for example, allows to generate and open multiple projects into Qt Creator and all projects may refer to the same Boost library. For instance, working with Boost.Geometry library, one may load Jamfile for tests and Jamfile for examples, selecting the same set of headers in both, and name the projects to reflect their purpose.
None, apart form plan to roll the project forward fixing bugs and adding features as they appear useful or necessary in order to make work with Boost.Build-based a bit more accessible and efficient.
See Future section for some feature ideas.
Fork the repo and make the plugin better!
An unprioritised TODO list for the plugin:
b2
command location not in PATH
.DeployConfiguration
and RunConfiguration
targets, if really needed.toolset
to additional arguments of step.
user-config.jam
lookup.user-config.jam
to determine some useful settings, projects that may be
referenced, include paths.
See also opened enhancement issues
at GitHub or search through the sources for TODO
, there is more items.