Skip to content

ECMGenerateExportHeader: add INCLUDE_FILES argument

Covers a typical use-case of CUSTOM_CONTENT_FROM_VARIABLE, cutting the need for the extra-variable dance. With KDE useful for the version header include proposed in kcoreaddons!310 (merged).

Example (before):

set(include_version_header_code "#include <kcoreaddons_version.h>\n")
ecm_generate_export_header(KF6CoreAddons
    BASE_NAME KCoreAddons
    GROUP_BASE_NAME KF
    VERSION ${KF_VERSION}
    DEPRECATED_BASE_VERSION 0
    EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
    CUSTOM_CONTENT_FROM_VARIABLE include_version_header_code
)

Example (with INCLUDE_FILES):

ecm_generate_export_header(KF6CoreAddons
    BASE_NAME KCoreAddons
    GROUP_BASE_NAME KF
    VERSION ${KF_VERSION}
    DEPRECATED_BASE_VERSION 0
    EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
    INCLUDE_FILES kcoreaddons_version.h
)

Merge request reports