Plugin CMake Builds

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.


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

Changing the location of the GUI repository

In case the GUI respository is not located alongside the plugin repository, there are two ways to specify its location

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 ..

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. 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

make install

afterwards will copy the plugin and any required files, if any, to the GUI's appropriate directories.

Windows

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).

To build the plugin on windows, open the generated oe_pluginname.sln Visual Studio solution file. Select the 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.

Selecting the INSTALL project and manually building it will trigger the install procedure, copying the plugin and any required files, if any, to the GUI's appropriate directories.

macOS

Similarly with Windows, open the oe_pluginname Xcode project. Building the ALL_BUILD scheme will build the plugin while selecting the INSTALL in the scheme selector and Building it will install the plugin.

The default build configuration is Debug. To build the plugin in Release mode either modify the scheme settings or, instead of clicking Project/Build to build and install the plugin select Project/Build for/Profiling