Skip to content

Global interface

Note: auto-generated from comments in: ./global_interface.cmake

global_interface.cmake:

This file provides an internal global interface target for use in the F Prime build system. Its job is to act as a singular target that has all the global properties that the build system requires. These include:

0. FPRIME_LOCATIONS: list of all "root" locations (source, binary)
1. FPRIME_SOURCE_LOCATIONS: list of all "root" locations of the project used for inferring target names.
2. FPRIME_BINARY_LOCATIONS: list of all binary equivalents of FPRIME_SOURCE_LOCATIONS in the build cache.
3. INTERFACE_INCLUDE_DIRECTORIES: list of all include directories that apply to all targets in the build system.
    a. These include all FPRIME_SOURCE_LOCATIONS, FPRIME_BINARY_LOCATIONS, and configuration directories
4. FPRIME_CHOSEN_IMPLEMENTATIONS: list of all chosen implementations for selectable build modules.

The global interface target also links to all BASE_CONFIG configuration modules. This allows modules to depend on, and receive include directories for all base configurations.

The target's name is stored in the FPRIME_GLOBAL_INTERFACE_TARGET cache variable and is available to all projects. Users must include this file to ensure that, should they be the first to need this target, it will be created.

A global target is preferable to global properties as it has several advantages. First, it allows for transitive properties for things like include paths. Second, its F Prime properties can be used in generator expressions.

CACHE VARIABLES: - FPRIME_GLOBAL_INTERFACE_TARGET: the name of the global interface target. Used when interfacing with the target

Function fprime_add_location_pair:

This function adds a source location and its corresponding binary location to the global interface target. This includes adding the SOURCE to FPRIME_SOURCE_LOCATIONS, the BINARY to FPRIME_BINARY_LOCATIONS and updating the INTERFACE_INCLUDE_DIRECTORIES and FPRIME_LOCATIONS property with both locations.

Arguments: - SOURCE: the source location to add - BINARY: the binary location to add Returns: None

Function fprime_add_historical_locations:

This function adds the list of historical locations to the global interface target. This is done for backwards compatibility with older versions of F Prime. This includes the following historical locations: - FPRIME_PROJECT_ROOT: the root source directory of the project, from settings.ini - FPRIME_FRAMEWORK_PATH: the source directory of the F Prime framework, from settings.ini - FPRIME_LIBRARY_LOCATIONS: the list of the library locations of the project, from settings.ini

Warning

This function and associated variables are deprecated. New projects and code should not use these variables.

Arguments: None Returns: None