Programming Howto:Building BCI2000

From BCI2000 Wiki
Jump to: navigation, search

This document describes how to build BCI2000, i.e. how to create the BCI2000 executables from their source code.

Prerequisites

  1. A C++ compiler. Currently, MSVC 2012 through 2017 are supported.
  2. Support for MSVC 2015 is broken in CMake. For a fix, you will need to copy RC.EXE and RCDLL.DLL from inside one of the Windows Kits into your MSVC 2015 VC/bin directory.
  3. To build GUI-related parts of BCI2000, a recent version of Qt5 is required. Use Qt's maintenance tool to select and install a version of Qt that matches your C++ compiler.
  4. CMake 3.11 or newer. Choose "add to path for all users" when prompted by the installer.

How to build

1. Start CMake

In the BCI2000 build directory, double-click Configure.sh.bat.

2. If using Qt on Windows, point CMake to it

  1. In the CMake GUI, click "Add Entry".
  2. Under Name, enter "Qt5_DIR" (case matters), and set "Type" to "PATH".
  3. Under Value, enter the path to your Qt distribution's lib/cmake/Qt5 directory.

E.g., if your Qt distribution for MSVC 2015, 64 bit, is located under D:/Qt/5.10.1/msvc2015_64, the "Qt5_DIR" CMake variable should point to D:/Qt/5.10.1/msvc2015_64/lib/cmake/Qt5.

3. Click "Configure"

From the list of compilers, choose the compiler that you would like to use. If using Qt, the compiler must match the Qt distribution chosen above.

4. Choose build options

  1. Make sure that "Grouped" is checked in the GUI, and "Advanced" is unchecked.
  2. Under the "BUILD" section, you may choose which parts of BCI2000 to build. Typically, you will want to have "BUILD_CONTRIB" checked.
  3. Under "EXTENSIONS", choose which extensions to include into the build.

5. Click "Generate"

A project/solution file will be created inside the BCI2000 build directory. Double-click it to open it in the IDE.

6. Build BCI2000 in full, or partially

In the IDE, choose which projects to build. You may right-click individual projects, or groups of projects, and choose "build" from the context menu.