oranges_add_build_type_macrosΒΆ

include (OrangesBuildTypeMacros)

View the full docs for this module.

oranges_add_build_type_macros (<targetName>
                              [BASE_NAME <baseName>]
                              [SCOPE <PUBLIC|PRIVATE|INTERFACE>])

Adds some preprocessor definitions to the specified target which describe the current build type being built.

Options:

BASE_NAME

Prefix used for each macro added to the target. Defaults to <targetName>.

SCOPE

Scope with which the compile definitions will be added to the target. Defaults to INTERFACE for interface library targets, PRIVATE for executables, and PUBLIC for all other target types.

This function adds the following preprocessor definitions, where <baseName> is all uppercase:

Macro name

Value

<baseName>_DEBUG

0 or 1

<baseName>_RELEASE

0 or 1

<baseName>_BUILD_TYPE

String literal, the exact name of the selected build configuration

Note

Each macro will always be defined to a value, so you should use #if to check their values, and not #ifdef.