Module
Note: auto-generated from comments in: ./module.cmake
Module.cmake:
This cmake file contains the functions needed to compile a module for F prime. This includes code for generating Enums, Serializables, Ports, Components, and Topologies.
These are used as the building blocks of F prime items. This includes deployments, tools, and individual components.
Function fprime__internal_add_build_target:
Processes the module arguments and set variables, then adds a build target with target properties set.
Target properties set: - SOURCES: source files (C++ build) - LINK_LIBRARIES: link dependencies (C++ build) - SUPPLIED_HEADERS: headers (for code counting) - SUPPLIED_SOURCES: original SOURCES before autocoding attached - SUPPLIED_DEPENDENCIES: original link dependencies before autocoding attached - AUTOCODER_INPUTS: input source file list for autocoding - FPRIME_TYPE: set to ${BUILD_TARGET_TYPE_STRING}
This function sets "INTERNAL_MODULE_NAME" in PARENT_SCOPE to pass-back module name for target registration. It also sets "INTERNAL_*" for each of the extra control directives for processing in the calling scope.
- BUILD_TARGET_TYPE_STRING: "Library", "Executable", "Deployment", and "Unit Test".
- EXTRA_CONTROL_DIRECTIVES: extra CMake
add_*arguments (e.g. INTERFACE for interface libraries)
Macro fprime__internal_close_control_set:
Finalizes the active control word (CURRENT_LIST_NAME) once its arguments have ended. Zero-argument flags that received no value become TRUE; list directives that received no values are an error.
Function fprime__process_module_setup:
This function is used to process the module setup. It takes a list of arguments and sorts them into SOURCES, HEADERS, and DEPENDS. It also sets the module name based on the first argument or the FPRIME_CURRENT_MODULE variable. If neither is provided, it will throw an error.
It handles the backwards compatibility with the old structure where users set SOURCE_FILES, MOD_DEPS, etc. variables.
- FPRIME_MODULE_TYPE: fprime type of module
- ADDITIONAL_CONTROL_SETS: additional control directives to support (e.g. INTERFACE for libraries)
- ARGN: list of arguments to process.
Function fprime__internal_mark_exclusion:
Excludes a newly registered target from all when it belongs to included code (the framework or a library) and
FPRIME_EXCLUDE_LIBRARIES_FROM_ALL is in effect. This is the same EXCLUDE_FROM_ALL a module sets through its register
call or inherits from a directory added with EXCLUDE_FROM_ALL: the target builds when named or depended upon, and
through universe (see fprime__internal_setup_universe_target).
- TARGET_NAME: name of the registered target
Function fprime__internal_setup_universe_target:
Creates the universe target (name: FPRIME_UNIVERSE_TARGET) depending on every module registered through the F Prime
API (the FPRIME_MODULES global property), excluded from all or not. Runs once, deferred to the end of the top-level
directory's configuration so that every module is known; builds the whole build system.
Function fprime__internal_add_build_target_helper:
Helper to add the target and set target properties.
Target properties set: - SOURCES: source files (C++ build) - LINK_LIBRARIES: link dependencies (C++ build) - SUPPLIED_HEADERS: headers (for code counting) - SUPPLIED_SOURCES: original SOURCES before autocoding attached - SUPPLIED_DEPENDENCIES: original link dependencies before autocoding attached - AUTOCODER_INPUTS: input source file list for autocoding - FPRIME_TYPE: set to ${BUILD_TARGET_TYPE_STRING}
- BUILD_TARGET_TYPE_STRING: "Library", "Executable", "Deployment", and "Unit Test".
- FPRIME_CMAKE_ADD_OPTIONS: extra CMake
add_*options (e.g. INTERFACE for interface libraries)