Module template: Install complete CMake export interface#1630
Conversation
Fixes module template so that new projects generate a viable C++ development package. Previous behavior: Creating a new Holoscan Module from template and then running default "./holohub package" commands would generate an incomplete C++ development package missing libraries and CMake import rules Updated: "./holohub package" installs binary operator libraries and CMake development files (*-config.cmake, *-targets.cmake) into the Debian package for distribution and reuse. Assisted-by: Claude:claude-opus-4.8 Signed-off-by: Tom Birdsong <tbirdsong@nvidia.com>
Greptile SummaryThis PR fixes the module template so that a newly generated C++ Holoscan module produces a complete Debian development package — including the operator's static library, CMake export/config files, and headers — enabling downstream
Confidence Score: 4/5Safe to merge for C++ module templates; Python-only module packaging will fail at CMake configure time due to referencing an unpopulated export set. The C++ path works end-to-end as shown in the PR description. However, the package-level CMakeLists.txt unconditionally passes EXPORT_NAME to holohub_configure_deb(), which triggers install(EXPORT holoscan__targets) even when the language is Python. Because the operator install(TARGETS ... EXPORT ...) is inside a Jinja2 C++ guard, the export set is never populated for Python modules, causing CMake to abort with an unknown-export error during ./holohub package on a Python-only template project. modules/template/{{cookiecutter.module_repo_name}}/pkg/{{cookiecutter.module_repo_name}}/CMakeLists.txt — the EXPORT_NAME argument needs a {%- if cookiecutter.language == 'cpp' %} guard to match the operator-level conditional. Important Files Changed
|
bhashemian
left a comment
There was a problem hiding this comment.
Apart from a potential issue (commented inline), it looks good to me! Thanks
| VENDOR "{% if cookiecutter.affiliation %}{{ cookiecutter.affiliation }}{% else %}NVIDIA{% endif %}" | ||
| CONTACT "{{ cookiecutter.contact_email }}" | ||
| DEPENDS "holoscan (>= {{ cookiecutter.holoscan_version }})" | ||
| EXPORT_NAME "holoscan_{{ cookiecutter.module_slug }}_targets" |
There was a problem hiding this comment.
The target is only being created when we have C++, right?
https://github.com/tbirdso/holohub/blob/cf3022a8441e7d711a4e12740e2a81e2e3d32e60/modules/template/%7B%7Bcookiecutter.module_repo_name%7D%7D/operators/%7B%7Bcookiecutter.operator_slug%7D%7D/CMakeLists.txt#L20-L21
However, the export statement here is unconditional and would be exported even when we have Python only. Should we make it conditional to the C++ language? Thanks
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThe templates now export the module package target for downstream ChangesCMake package export setup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
Overview
Fixes module template so that new projects generate a viable C++ development package.
Previous behavior
Creating a new Holoscan Module from template and then running default "./holohub package" commands would generate an incomplete C++ development package missing libraries and CMake import rules
Updated
"./holohub package" installs binary operator libraries and CMake development files (*-config.cmake, *-targets.cmake) into the Debian package for distribution and reuse.
Result
Follow-up tasks
Improve CI/CD coverage to generate and exercise Debian C++ development interface from a new module.
Assisted-by: Claude:claude-opus-4.8
Summary by CodeRabbit
New Features
Documentation