fprime-cmake-build-system
Skill này làm gì
Skill giải thích cách lớp CMake của F Prime đăng ký module, thiết lập build target và chọn nền tảng. Dành cho kỹ sư xây dựng phần mềm bay F Prime.
Khi nào nên dùng
- ✓Khi bạn thêm một module mới vào bản build F Prime.
- ✓Khi bạn chuyển F Prime sang một nền tảng mới hoặc toolchain cross-compile mới.
- ✓Khi một bước generate hoặc build trong dự án F Prime thất bại và bạn cần biết nguyên nhân.
Liên kết skill
https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-cmake-build-system/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể giúp tôi đăng ký module F Prime mới trong bản build CMake và sửa lỗi generate không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI dùng các hàm đăng ký và cấu trúc build của F Prime, kiểm tra nền tảng và cấu hình, rồi build lại để xác nhận đã sửa xong.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Skill: F Prime CMake Build System
F Prime wraps CMake in an API layer so that modules declare sources and autocoder inputs and get autocoding, dictionaries, unit tests, and install rules for free. Canonical references:
- Build system user manual
- API and options reference — generated from the docblocks in
API.cmakeandoptions.cmake; read those files directly, they are the source of truth - Build system SDD (requirements, ops concepts)
Follow those for full syntax and examples; this skill adds orientation, decision criteria, and the failure modes that are easy to get wrong.
1 — Where things live under cmake/
| Path | Contents |
|---|---|
API.cmake |
The public register_fprime_* / add_fprime_subdirectory API |
module.cmake, config_assembler.cmake |
Internal module and configuration processing |
target/ |
Built-in targets: build, ut, dictionary, install, sbom, version |
target/sub-build/ |
Targets run in sub-builds (fpp_locs, fpp_depend, module_info) |
autocoder/ |
Autocoder integration (fpp.cmake, fpp_ut.cmake) |
platform/ |
${FPRIME_PLATFORM}.cmake platform files (Linux, Darwin, templates) |
toolchain/ |
Cross-compile toolchain files |
settings/, options.cmake, flags.cmake, sanitizers.cmake |
Build settings, options, compile flags |
test/ |
pytest suite for the build system itself |
Change the narrowest layer that solves the problem: a module's own
CMakeLists.txt first, then a platform/toolchain file, and only then
cmake/ internals (which affect every project using F Prime).
2 — Which registration call
| Task | Call |
|---|---|
| Component, port, or plain library module | register_fprime_module |
| Deployment producing an F Prime binary | register_fprime_deployment |
| Non-deployment executable / tool | register_fprime_executable |
| Unit test | register_fprime_ut (see fprime-unit-testing) |
| Configuration module (framework, platform, library, or project overrides) | register_fprime_config |
Implementation of a swappable package (e.g. Os_File) |
register_fprime_module + IMPLEMENTS; register_os_implementation for OSAL packages |
Custom build target (<target> + <MODULE>_<target>) |
register_fprime_target / register_fprime_ut_target |
Common directives: SOURCES, AUTOCODER_INPUTS, HEADERS, DEPENDS,
REQUIRES_IMPLEMENTATIONS, CHOOSES_IMPLEMENTATIONS. A new module
directory must also be pulled in with add_fprime_subdirectory from
the including CMakeLists.txt.
Guides: customization / custom targets, configuration modules, implementations, platforms, toolchains, settings.ini, external libraries, OSAL implementation.
3 — Failure modes
- Stale cache: a build cache can go out of date in many ways —
edited
settings.ini, a newCMakeLists.txtor FPP file, a moved module, a switched toolchain. Symptoms are confusing missing-target, missing-autocode, or stale-dependency errors rather than compiler errors. Fix withfprime-util generate -f(--utfor the unit-test cache), which purges and regenerates the build cache. - Unresolved implementation: every platform must
CHOOSES_IMPLEMENTATIONSfor every package a moduleREQUIRES_IMPLEMENTATIONS; a missing choice surfaces as a link error, not a CMake error. Use the_Stubimplementation when a platform lacks the capability; override in the project's configuration module (CHOOSES_IMPLEMENTATIONS) or per deployment, executable, or UT. - Sub-build assumptions: code that must not run during the
fpp_locs/fpp_dependsub-builds needsskip_on_sub_build(); platform-specific modules needrestrict_platforms(...). - Hardcoded host paths or tool locations in a toolchain belong in
an
environment_file, not in committed CMake. - **Bypassing the
Câu hỏi thường gặp
Tôi có cần biết CMake trước không?
Có kiến thức CMake cơ bản sẽ hữu ích, dù skill có giải thích lớp bao (wrapper) riêng của F Prime.
Skill có bao quát các nền tảng khác nhau không?
Có. Skill bao gồm file nền tảng, file toolchain và cách chọn triển khai hệ điều hành.
Các quy tắc chính xác nằm ở đâu?
Skill chỉ đến sách hướng dẫn hệ thống build của F Prime và các file API để xem cú pháp chính xác.
Chi tiết
Mô tả gốc của tác giả
Work with F Prime's custom CMake layer: the `register_fprime_*` API, build targets, toolchains and platform files, implementation selection, configuration modules, sub-builds, and `settings.ini`. Use when adding or wiring a module into a build, adding a custom build target, porting to a new platform or toolchain, choosing or defining an Os implementation, or diagnosing generate/build failures that are not compiler errors.
repo: nasa/fprime
Độ phổ biến
- Sao GitHub
- 12k
- Vị trí xếp hạng
- #11493
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
fprime-component-design-fpp
12kGiúp agent của bạn chuyển các yêu cầu thành phần F Prime đã được duyệt thành mô hình FPP cho các port, lệnh, sự kiện và telemetry.
fprime-component-development
12kGiúp agent của bạn hướng dẫn một thành phần F Prime qua từng giai đoạn phát triển, từ yêu cầu đến kiểm thử tích hợp.
fprime-component-implementation
12kGiúp agent của bạn viết mã C++ phía sau các hàm xử lý được sinh tự động của một thành phần F Prime, theo đúng quy tắc của dự án.
fprime-component-integration-test
12kGiúp agent của bạn viết các bài kiểm thử tích hợp pytest dùng lại được cho thành phần F Prime, chạy trên một triển khai đang hoạt động.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.