oranges_generate_platform_header

include (OrangesGeneratePlatformHeader)

View the full docs for this module.

oranges_generate_platform_header (<targetName>
                                 [BASE_NAME <baseName>]
                                 [HEADER <headerName>]
                                 [LANGUAGE <CXX|C|OBJCXX|OBJC|Fortran|ASM>]
                                 [SCOPE <PUBLIC|PRIVATE|INTERFACE>]
                                 [INSTALL_COMPONENT <componentName>] [REL_PATH <installRelPath>])

Generates a header file containing various platform identifying macros for the current target platform.

The value of each macro in the generated header file will be set from a corresponding cache variable, which allows the user a high level of configurability, and the ability to override specific details about the current platform as needed. The entire set of cache variables used to store platform attributes is initialized when this module is first included. Thus, you can use this module’s cache variables in your CMake scripts without actually generating a header file.

Options:

BASE_NAME

Prefix to use for all macros in the generated header file. Defaults to <targetName>.

HEADER

Name of the header file to be generated. Defaults to <baseName>_platform.h.

LANGUAGE

Some of the platform introspection requires specifying a language, because some features may be compiler-specific. For these options, the cache variables are suffixed with <lang> (where lang is the language in all-uppercase), so that multiple settings can be saved (and overridden) for different languages. Defaults to the value of the PLAT_DEFAULT_TESTING_LANGUAGE variable.

SCOPE

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

INSTALL_COMPONENT

An install component the generated header will be added to. This command will not create the install component.

REL_PATH

Path below CMAKE_INSTALL_INCLUDEDIR where the generated file will be installed to. Defaults to <targetName>.