qiBuild in five minutesΒΆ

Create a worktree:

$ cd ~/src
$ qibuild init
  • Create a world library in the world project, in src/world
$ cd ~/src/world
$ $EDITOR CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(world)
include("qibuild.cmake")

qi_create_lib(world world/world.hpp world/world.cpp)
qi_stage_lib(world)
  • Make world depend on ode
$ $EDITOR qibuid/modules/ode-config.cmake
clean(ODE)
fpath(ODE ode/ode.h)
flib(ODE ode)
export_lib(ODE)
qi_use_lib(world ODE)
  • Create a hello in the hello project, in src/hello, using the world library:
$ cd ~/src/hello
$ $EDITOR qibuild.manifest
[project hello]
depends = world
$ $EDITOR CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(hello)
include("qibuild.cmake")

qi_create_bin(hello main.cpp)
$ cd ~/src
$ qibuild configure hello

Call cmake on world, then hello

$ qibuild make hello

Build world, then hello, automagically
linking `src/hello/build/sdk/bin/hello` with
`src/world/build/sdk/lib/libworld.so`
  • Distribute the world project to the world, step 1: Add install rules for world header
qi_install_header(world/world.hpp SUBFOLDER world)
  • Distribute the world project to the world, step 2: Generate world package in ~/src/packages/world.tar.gz using cmake install rules.
$ qibuild package world
  • Distribute the world project to the world, step 3: Upload the package along with a feed description:
<toolchain>
  <package
   name="world"
   url="htpp://example.com/world.tar.gz"
  />
 </toolchain>
  • Use the world package from an other machine:
$ qitoolchain create $NAME htpp://example.com/feed.xml

Add package from htpp://example.com/world.tar.gz to
a toolchain named $NAME

$ qisrc add git@git.example.com/hello.git

Get hello sources from a git repository

$ qibuild configure -c $NAME hello

No need for world sources, using pre-compiled library
from the world package