This page details the ways you can export your application for distribution

Installation directories and configuration

This part of the page expects full knowledge of the Config files and folder structure page.

Unix

On Unix systems such as Linux, the FHS(Filesystem Hierarchy Standard) defines installation directories. The following directories are of interest:

By default, no user interaction is needed to control installation directories, since we already have enough metadata to calculate correct file placement. However, in some cases, it may be useful to override these locations(e.g. in cases where you're developing a plugin for an application). This can be achieved by modifying your uvproj.yaml file to look like this:

name: "my-application"
version: "1.0.0.0"
engine-version: "1.0.0.0"
enabled-modules:
  os: false
  dbus: false
  uexec: false
  theming: false
  notifications: false
  polkit: false
  ufont: false
  i18n: false
  undo_redo: false
  plotting: false
  knobs: false
  spinners: false
  toggles: false
  text_utils: false
  cli_parser: false
install-override:
  unix:
    framework-library-dir: "lib/"
    framework-application-library-dir: "lib/"
    application-binary-dir: "bin/"
    config-dir: "share/config/my-application/"
    content-dir: "share/my-application/"
    framework-include-dir: "include/my-application/"
    application-include-dir: "include/my-application/"

This example uses the default directories. For example, you can change the application-binary-dir to libexec when developing an IBus engine

Additionally, you can add custom install directives for files. For example, using the following config:

additional-installs:
  unix:
    - file: test.txt
      directory: "tmp/"
      macro-name: UNIX_TEST_INSTALL_DIR
      is-directory: false

The macro-name string field is used to generate a compiler macro definition that points to the directory listed.

The is-directory boolean field is used to define whether the file field points to a file or directory so that the right installation algorithm is used.

Tip: When installing on Unix systems, try to also consider the XDG Base directory specification when deciding on installation directories.

Windows

On Windows, there is no directory structure similar to that on Unix systems. For that reason, we install all files under C:/Program Files/<Your application here>, because most applications are installed there. Therefore, it makes sense to the user to also find your application there.

As on Unix, you can also override this directory like this:

install-override:
  windows:
    framework-library-dir: "Program Files/my-application/"
    framework-application-library-dir: "Program Files/my-application/"
    application-binary-dir: "Program Files/my-application/"
    config-dir: "Program Files/my-application/"
    content-dir: "Program Files/my-application/"
    framework-include-dir: "Program Files/my-application/"

The folder for the application will be created automatically.

Furthermore, additional installation directives can also be added, just like on Unix:

additional-installs:
  window:
    - file: test.txt
      directory: "C:/"
      macro-name: WINDOWS_TEST_INSTALL_DIR
      is-directory: false

Compiling for production

This section will detail all steps to compile your application for production

Files and directory access

Check for any cases where a file is not using predefined directory prefix macros. Documentation can be found on the directory strings and Config.hpp pages.

Enable file logging

It may be useful to log the state of the application to a file. To enable file logging, call the following functions:

Logger::setCurrentLogFile("log.txt"); // Replace this with any other file name and location
Logger::setLogOperation(UVK_LOG_OPERATION_FILE_AND_TERMINAL); // Sets the logging mode to file and terminal

* Please keep in mind that the terminal/console will be hidden when compiling for production on Windows.

Define your application distribution type

There are 3 variables that define your distribution type:

  1. vendored - Means that all libraries including the framework will not be dynamically linked from the same libraries in PATH
  2. static - Will compile the framework, application library and executable into a single executable(libraries will be linked dynamically)
  3. system-wide - When this is set to true it enables every module, regardless of settings. This is useful when the framework library has to be shipped system-wide on a Unix system
  4. install-framework - When set to true, the framework headers will be installed. Defaults to false

This can be defined in the uvproj.yaml like this:

name: "ude-welcome"
version: "1.0.0.0"
engine-version: "1.0.0.0"
build-mode-vendored: false
build-mode-static: false
system-wide: false

Unix

On Unix systems, it's recommended that you do not enable vendored builds, as the framework may already be installed globally.

Windows

On Windows systems, it's recommended that you run a vendored build. Static builds are also recommended, except for cases where plugin support for the application is enabled.

Configure production settings

Additionally, the uvproj.yaml file allows you to set production settings under the production key:

name: "ude-welcome"
version: "1.0.0.0"
engine-version: "1.0.0.0"
build-mode-vendored: false
build-mode-static: false
system-wide: false
production:
  crash-on-error: true

List of keys:

  1. crash-on-error - can be used to override the default functionality of crashing when an error is printed using UntitledLog. By default, applications are set to crash on error when compiled for production. Setting this to false lets disables this functionality after the renderer is started. If you need to disable crashing on error at an earlier stage, insert this line: Logger::setCrashOnError(false) in your Instance's constructor.

Export using the UVKBuildTool

Once configured, go to the UVKBuildTool folder and run https://madladsquad.com/UVKBuildTool --build <prefix> <directory to project>. The build tool will then compile and install everything as expected.