Skip to content

Building from Source

Paul Colby edited this page Aug 23, 2015 · 7 revisions

Bipolar supports out-of-source builds on all supported platforms.

The basic steps are the same on all platforms. The syntax just varies a little depending on the shell / toolset in use.

The overall steps are:

  1. Create a new build directory.
  2. Change into the build directory.
  3. Execute qmake. I like to run it recursively (the -r flag) to see QMake warnings earlier.
  4. Run the the platform's "make" tool (eg make, mingw32-make.exe, nmake.exe, etc).
  5. Optionally, run "make" for the "check" target to run all of the unit tests (this can take several minutes).
  6. Optionally, on supported platforms, run "make" for the relevant package target (eg dmg to build an OSX disk image; nsis to build an NSIS-based Windows installer).

Linux

A basic example for building on a typical GNU / Linux operating systems:

mkdir -p <build-directory>
pushd <build-directory>
qmake -r -Wall -Wlogic -Wparser <source-directory>
make && make check
popd

For a more-advanced example, have a look at the .travis.yml configuration. Unfortunately that example mixes both Linux (Ubuntu) and OSX implementations (Travis CI currently only supports one configuration file for both), so that does make it a little unnecessarily complex.

MacOS

A basic example for building on MacOS:

mkdir -p <build-directory>
pushd <build-directory>
qmake -r -Wall -Wlogic -Wparser <source-directory>
make && make check && make -C pkg/osx dmg
popd

For a more-advanced example, have a look at the .travis.yml configuration. Unfortunately that example mixes both Linux (Ubuntu) and OSX implementations (Travis CI currently only supports one configuration file for both), so that does make it a little unnecessarily complex.

Windows

Building on Windows varies a little depending on the choice of build toolset - ie MinGW versus MSVC. See examples of each below.

MinGW

A basic example for building on Windows, using MinGW:

mkdir -p <build-directory>
pushd <build-directory>
qmake -r -Wall -Wlogic -Wparser <source-directory>
mingw32-make.exe
mingw32-make.exe check
mingw32-make.exe -C pkg/nsis nsis
popd

For a more-advanced example, have a look at the .appveyor.yml configuration. That example mixes both MinGW and MSVC implementations, so that does make it a little more complex.

MSVC

A basic example for building on Windows, using MSVC:

mk <build-directory>
pushd <build-directory>
qmake -r -Wall -Wlogic -Wparser <source-directory>
nmake.exe
nmake.exe check
pushd pkg\nsis
namke.exe nsis
popd
popd

For a more-advanced example, have a look at the .appveyor.yml configuration. That example mixes both MinGW and MSVC implementations, so that does make it a little more complex.