cmopts_setup_target#

This function is intended as a convenience entry point for all functionality provided by cmopts module.

It aims to perform all heavy lifting for setting up various target compiler definitions, target properties, and enable different tools for static and dynamic analysis of the target.

cmopts_setup_target(<target> [NO_CHECKS] [STRIP])

Arguments#

The named <target> must have been created by a command such as add_executable or add_library and must not be an ALIAS target.

If NO_CHECKS is given then all non-mandatory compilation warnings will be disabled. See this CMake file for details.

If STRIP is given then resulting executable or shared library will be striped.

Output#

The function adjusts target accordingly to what cmopts module options have been set.

The options, that affect the end result, are:

Beside that the function performs other actions that are not configurable yet. Those actions are:

  • enforcing all warnings to be treated as errors,

  • enabling all reasonable compiler warnings (full list).