Creating Build files

Build files for the GUI and plugins are generated using CMake, a widely used automated build generation tool. This allows generating build files for any of the three supported operating systems from a single set of rules.

Installing CMake

On Linux, CMake should be installed via the distribution official package system. For Ubuntu and other Debian-based distributions execute

sudo apt-get update
sudo apt-get install cmake

On Windows and Mac, it can be downloaded from its official download page.

On Windows, it is highly recommended to select the option "Add CMake to the system PATH" for either all users or current users, as it will allow easy use of the command line tools.

On Mac, it is recommended to run the following command to install system-wide access to the command line tools

sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install

Creating build files

CMake can be used to create build files for any target. To do so, CMake must be invoked from the Build subdirectory:

cd Build
cmake -G "<GENERATOR>" .. (for Windows and Mac build files, see below for Linux)

<GENERATOR> tells CMake which kind of build files to create. Examples of valid generators are:

"Visual Studio 12 2013 Win64"
"Visual Studio 14 2015 Win64"
"Visual Studio 15 2017 Win64"

"Visual Studio 16 2019" -A x64

"Xcode"

"Unix Makefiles"

(For 32bit windows just remove Win64 from the generator string)

Note that the generated build files use absolute paths, so they might not be usable outside of the system that generated them.

Linux build files

Since Linux Makefiles are created for a single configuration, it is necessary to specify if the Makefile is to be created for Debug or Release. To do so, the CMAKE_BUILD_TYPE variable must be manually set by calling cmake like:

cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
or
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..

Note that setting a variable using the -D argument will be permanent, with following calls to cmake in the same folder using its set value even if the argument is not used in them. Variables can be either set to a different value by calling cmake with a different -D option overwriting the existing value or unset by calling cmake -UVARIABLE. 

Deleting all files on the directory will also delete the set values, so any call to cmake from an empty directory must set all required -D parameters.

Create build files outside of Build directory

For the core GUI, calling CMake from the Build subdirectory is mandatory, as plugin build files will look for this path for building and installing. Trying to run the CMake script from other path will result in an error.
Although not recommended, this error can be overriden by setting the OE_DONT_CHECK_BUILD_PATH variable to TRUE using the -D option