Skip to content

Target

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

Target.cmake:

Functions supporting the F prime target additions. These targets allow building against modules and top-level targets. This allows for multi-part builds like sloc or dict where some part applies to the module and is rolled up into some global command.

Function get_target_name:

Gets the target name from the path to the target file. Two variants of this name will be generated and placed in parent scope: TARGET_NAME, and TARGET_MOD_NAME.

  • MODULE_NAME: module name for TARGET_MOD_NAME variant
  • Return: TARGET_NAME (set in parent scope), global target name i.e. dict.
  • Return: TARGET_MOD_NAME (set in parent scope), module target name. i.e. Fw_Cfg_dict

Note: TARGET_MOD_NAME not set if optional argument MODULE_NAME not supplied

Function setup_global_targets:

Loops through all targets registered and sets up the global target.

Checks all ARGN supplied arguments to determine if they should have existed for deployment recursion to work properly. If an argument is a file (i.e. a library or other file), a linker flag (-), a generator expression ($) then these are passed. Anything else results in an error.

  • DEPLOYMENT_NAME: name of deployment being recursed for cleaner error messages
  • ARGN: list of unknown targets to check

Function setup_global_target:

Setup a given target file in global scope. This also includes the target file once and thus must be called regardless of the actual existence of a global entry point for a given target. All targets must define a function of the form ${TARGET_NAME}_add_global_target though it may be empty.

TARGET_FILE: target file to include

Function setup_single_target:

Setup a given target file's module-specific targets. There are two module-specific target options. The first is a normal module target called through ${TARGET_NAME}add_module_target. This is for setting up items registered through register_fprime_module calls. The second is called through ${TARGET_NAME}_add_deployment_target and responds to calls of register_fprime_deployment. Both add*_target functions must be defined, may be empty implementations. Only one of the two functions will be called for a given module.

TARGET_FILE: target file to include MODULE: module being processed SOURCES: sources specified with set(SOURCE_FILES ...) in module's CMakeLists.txt DEPENDENCIES: dependencies and link libraries specified with set(MOD_DEPS ...) in module's CMakeLists.txt

Function setup_module_targets:

Takes all registered targets and sets up the module specific targets from them. The list of targets is read from the global property FPRIME_TARGET_LIST.

  • MODULE: name of the module being processed
  • SOURCES: sources specified with set(SOURCE_FILES ...) in module's CMakeLists.txt
  • DEPENDENCIES: dependencies and link libraries specified with set(MOD_DEPS ...) in module's CMakeLists.txt

See Also:

  • API: API describes the register_fprime_target function