Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Creating build files

...

Installing CMake

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

Code Block
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

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

Creating build files

...

IMPORTANT: The plugin repository must be cloned inside a directory (e.g. OEPlugins) that is at the same level as the GUI repository directory. For example, if the GUI is located in /usr/src/open-ephys/plugin-GUI the plugin should be in /usr/src/open-ephys/[OEPlugins]/PuginName. Please look below if the GUI repository must be located in a different location.


CMake can be used to create To generate build files for any target. To do so, just create a new directory under the Build directory and call cmake like this

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

<PLATFORM> means your target. It can be any name, but we recommend a descriptive name like "Linux" or "VS2013"

<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"
"Xcode"
"Unix Makefiles"

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

This way, multiple sets of build files could be created. Note, however, 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, cmake must be called like:

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

plugins follow the general instructions on build files creation through CMake.

Changing the location of the GUI repository

...

Code Block
1) Creating an environment variable called GUI_BASE_DIR
export GUI_BASE_DIR=path/to/GUI
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
or
GUI_BASE_DIR=/path/to/GUI cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..

2) By using a cmake variable with the -D argument
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DGUI_BASE_DIR=/path/to/GUI ..

Note Remember 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. This is also true for the MAKE_BUILD_TYPE option.

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.

...

The build files creation page has info on how to unset o change them.

Building and Installing plugins

IMPORTANT: Before building a plugin, the build files for the base GUI must have been created by running cmake for it, as the process creates some files needed by the plugins.

Linux

Just like with most Linux sources, just execute

make

inside the Build directory to build the plugin. Executing

...

IMPORTANT: Before building any plugin on windows, in addition of having created the base GUI's build files it must also have been built in the desired configuration (Release or Debug) must have been built.

To build the plugin on windows, open the generated oe_pluginname.sln Visual Studio solution file. Select the apropriate appropriate configuration (Debug/Release) and either build the solution or build the ALL_BUILD project. That will run the build process on all projects except INSTALL, thus building the plugin.

...