Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Install Logic Checklist #655

Open
cyrush opened this issue Aug 30, 2023 · 0 comments
Open

CMake Install Logic Checklist #655

cyrush opened this issue Aug 30, 2023 · 0 comments

Comments

@cyrush
Copy link
Member

cyrush commented Aug 30, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant