Skip to content

CMake Install Logic Checklist #655

@cyrush

Description

@cyrush

These will eventually make it into BLT docs as recommendations, but to start our list:

  • Provide detailed installed cmake config file that reflects the features that your project was configured with:

https://github.com/LLNL/conduit/blob/develop/src/config/ConduitConfig.cmake.in

  • On import, use import relative paths when looking for features and setting up combined targets:

https://github.com/LLNL/conduit/blob/d495f3f820508070210d22e88a910f28dca212cd/src/config/conduit_setup_deps.cmake#L17
https://github.com/LLNL/conduit/blob/d495f3f820508070210d22e88a910f28dca212cd/src/config/conduit_setup_targets.cmake#L67

  • On import, resolve any dependencies that have not been found. But default, use paths that reflect the TPLs that your install was configured against. Allow TPL dirs to be overridden in downstream projects via vars like ZZZ_DIR. Even if you support a different case (zzz_DIR or Zzz_DIR OR zZz_dIr ), also support ZZZ_DIR for consistency across packages.

https://github.com/LLNL/conduit/blob/d495f3f820508070210d22e88a910f28dca212cd/src/config/conduit_setup_deps.cmake#L86

  • When exporting targets, use a -targets suffix in the exported target name, such as:

https://github.com/LLNL/axom/blob/c36a089e8fd0672c43e95ca9e22bb93708132032/src/axom/CMakeLists.txt#L42

if you use your project's base name, you can encounter problems:

https://github.com/LLNL/conduit/blob/d495f3f820508070210d22e88a910f28dca212cd/src/config/ConduitConfig.cmake.in#L6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions