ROCMCreatePackage

Contents

ROCMCreatePackage#

Applies to Linux and Windows

2024-02-21

4 min read time

Commands#

rocm_create_package#
rocm_create_package(
    NAME <name>
    [DESCRIPTION <description>]
    [SECTION <section>]
    [MAINTAINER <maintainer>]
    [LDCONFIG_DIR <lib-directory>]
    [PREFIX <path>]
    [LDCONFIG]
    [HEADER_ONLY]
)

Sets up CPack packaging, including installing the license file to the correct location and component. If the license file is not specified, also attempts to locate a LICENSE, LICENSE.md, or LICENSE.txt file in CMAKE_SOURCE_DIR.

If the CPACK_GENERATOR has not been specified then if ROCM_PKGTYPE is set then use that to set it, otherwise probe the system to see what programs are available.

rocm_package_add_rpm_dependencies#
rocm_package_add_rpm_dependencies(
    [QUIET]
    [COMPONENT <component>]
    [DEPENDS <dependencies>...]
    [SHARED_DEPENDS <dependencies>...]
    [STATIC_DEPENDS <dependencies>...]
)

Sets up the RPM package for a component to depend on some other packages, possibly versioned. The dependencies should be listed in RPM format (e.g. foo > 0.3 or bar = 1.0). Will warn if the package has already been created, unless QUIET is specified.

rocm_package_add_deb_dependencies#
rocm_package_add_deb_dependencies(
    [QUIET]
    [COMPONENT <component>]
    [DEPENDS <dependencies>...]
    [SHARED_DEPENDS <dependencies>...]
    [STATIC_DEPENDS <dependencies>...]
)

Sets up the deb package for a component to depend on some other packages, possibly versioned. The dependencies may be listed in RPM format (e.g. foo > 0.3 or bar = 1.0), and will automatically be converted to the DEB formatting. Will warn if the package has already been created, unless QUIET is specified.

rocm_package_add_dependencies#
rocm_package_add_dependencies(
    [QUIET]
    [COMPONENT <component>]
    [DEPENDS <dependencies>...]
    [SHARED_DEPENDS <dependencies>...]
    [STATIC_DEPENDS <dependencies>...]
)

A convenience function wrapping both rocm_package_add_rpm_dependencies and rocm_package_add_deb_dependencies. The dependencies must be listed in RPM format (e.g. foo > 0.3 or bar = 1.0), and will automatically be converted to the DEB formatting. Will warn if the package has already been created, unless QUIET is specified.

rocm_package_setup_component#
rocm_package_setup_component(
    <component-name>
    [PACKAGE_NAME <package-name>]
    [LIBRARY_NAME <library-name>]
    [PARENT <parent>]
    [DEPENDS
        [COMMON <common-dependencies>...]
        [RPM <rpm-dependencies>...]
        [DEB <deb-dependencies>...]
        [COMPONENT <component-dependencies>...]
    ]
)

Set up a component for packaging. Sets the package name, and adds dependencies as appropriate. Component dependencies are where the package generated by component A depends on the package generated by component B. In order to ensure that these dependencies correctly use the generated package names, these dependencies are not fully added until the packages are generated.