Skip to content

Compiling and Running

Alex May edited this page Mar 8, 2024 · 3 revisions

This page is for developers and Fugio v4.0 onwards - not Fugio v3.1 or earlier.

It documents how to compile and run Fugio for development and deployment. Distribution isn't covered yet.

Introduction

Fugio is a highly modular system, which means that the code is distributed over several source code repositories. This choice was made to reduce the number of external dependencies when working on individual plugins, at the expense of more configuration for developers who want to port Fugio to other platforms.

Fugio is written in C++ and built using CMAKE on Qt.

Fugio compiles Qt 6, but generally supports Qt 5.15 as well.

Plugin development will require a comfortable level of experience with C++ and Qt, specifically working with C++ interfaces and Qt's signal and slots.

Core system development and porting to other platforms will require an advanced experience level.

Caveats

Debug Builds

As of Fugio 4.0, developing new or existing plugins can be done without compiling any other parts of the system with one caveat: Qt can't load a mix of debug and release libraries.

This means, if you want to debug your plugin, you will to build a debug build of Fugio and any plugins that your plugin relies upon. This will probably include at least fugio-core-plugins. You may possibly be able to run a 'Release with Debug Info' build, but I haven't tried this.

The instructions for doing so are below.

Platform Support

Fugio is actively built on Windows, with support for Linux (including Raspberry Pi) being a secondary aim.

macOS has proven too difficult to actively develop a reliable binary distribution for due to multiple issues around packaging, code signing, and lack of legacy software and hardware support.

If someone wants to do a macOS build from source, or attempt a distribution, the code should largely compile fine, but we are not testing it so there may be incompatibilities.

Signals and Slots

Because Fugio uses a header-only API approach, the new (and better) format of QObject::connect() that uses function signatures will not work. You must use the old SIGNAL() and SLOT() macros when connecting to Fugio interfaces. Internally, you can use the new format.

Repositories

  • Fugio - the editor, library, plugin manager, and library API (no plugins)
  • fugio-core-plugins - core plugins that only require Qt to compile
  • fugio-portaudio - audio recording and playback using the PortAudio library (requires Qt and PortAudio)
  • etc...

There will be an example plugin template soon.

API

Each repository publishes its own API in a ZIP file that can be downloaded as needed by CMake.

Building Fugio

  • Install Qt including Serial Port and Web sockets
  • Clone the Fugio repository
  • Select the additional 'fugio-api' build target, which will create fugio-api.zip in the build directory

Running Fugio

  • For development, it is suggested to set the config file and plugin cache to point somewhere else than the default locations so you can load debug plugins
  • Run Fugio.exe -c 'path to fugio.ini' -pc 'directory of plugin-cache'
  • Working directory should be your build directory

Building fugio-core-plugins

  • Install Qt including Serial Port and Web sockets
  • Clone the fugio-core-plugins repository
  • Set the following CMake variables:
  • FUGIO_API_ZIP_URL - URL to fugio-api.zip (either from a GitHub release or local build) local example: file:///C:/dev/fugio/build-Fugio-Debug/fugio-api.zip
  • FUGIO_PLUGIN_URL - URL for use in the generated plugin manifest file - for development it should be your build directory, example: file:///C:/dev/fugio/build-fugio-core-plugins-Debug
  • Select the additional 'package' and 'fugio-plugin-manifest' build targets (for all builds, including debug)

This will create zip files for each plugin and a fugio-manifest.json file in your build directory.

Running fugio-core-plugins

  • Run Fugio.exe -c 'path to fugio.ini' -pc 'directory of plugin-cache' --repo-reload com.bigfug.fugio.core
  • Working directory should be your build directory
  • On Windows, I had to append the Qt binary path to the PATH environmental variable before Fugio would run. Eg C:\Qt\6.6.2\msvc2019_64\bin

Before running, I would recommend deleting the fugio.ini and plugin cache. When Fugio runs and asks you whether you want to install the default plugins, choose 'Local...' and load the fugio-manifest.json in your plugin build directory.

The --repo-reload command line argument will make Fugio reload the plugins from the repository every time it is run so any changes you have made will be loaded.

Building fugio-portaudio

This example is included because it requires both the Fugio API and the fugio-core-plugins API, which most plugins will need.

Currently the design for plugins is to have libraries statically linked. This approach may need to be adjusted in the future.

  • Install Qt including Serial Port and Web sockets
  • Clone the fugio-portaudio repository
  • Set the following CMake variables:
  • FUGIO_API_ZIP_URL - URL to fugio-api.zip (either from a GitHub release or local build) local example: file:///C:/dev/fugio/build-Fugio-Debug/fugio-api.zip
  • FUGIO_CORE_API_ZIP_URL - URL to fugio-core-api.zip (either from a GitHub release or local build) local example: file:///C:/dev/fugio/build-fugio-core-plugins-Debug/fugio-core-api.zip
  • FUGIO_PLUGIN_URL - URL for use in the generated plugin manifest file - for development it should be your build directory, example: file:///C:/dev/fugio/build-fugio-portaudio-Debug
  • Select the additional 'package' and 'fugio-plugin-manifest' build targets (for all builds, including debug)

This will create zip files for each plugin and a fugio-manifest.json file in your build directory.

Running fugio-core-plugins

  • Run Fugio.exe -c 'path to fugio.ini' -pc 'directory of plugin-cache' --repo-reload com.bigfug.fugio.portaudio
  • Working directory should be your build directory
  • On Windows, I had to append the Qt binary path to the PATH environmental variable before Fugio would run. Eg C:\Qt\6.6.2\msvc2019_64\bin