qt-cmake-project

Generate and update Qt 6 CMake projects with CMakeLists.txt edits.

351|38|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/TheQtCompanyRnD/agent-skills --skill qt-cmake-project
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: qt-cmake-project
Source: https://github.com/TheQtCompanyRnD/agent-skills/tree/main/skills/qt-cmake-project
Command: npx skills add https://github.com/TheQtCompanyRnD/agent-skills --skill qt-cmake-project

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps AI coding tools set up and evolve modern Qt 6 projects, ensuring compliance with Qt 6 CMake API standards and best practices.

Core Features & Use Cases

  • Qt 6 CMake Project Setup: Bootstraps Qt 6 projects with correct top-level layouts, avoiding legacy qmake and qt5_* macros.
  • CMakeLists.txt Editing: Provides guidelines for editing existing CMakeLists.txt files, preserving style where appropriate and correcting common mistakes.
  • Resource Management: Offers guidance on organizing static resources like images, icons, fonts, and translations.
  • Documentation Lookup: Provides instructions for querying Qt docs for command signatures and fallbacks to web documentation.
  • Error Handling: Implements guardrails to ensure safety and prevent common mistakes in Qt CMake code generation.
  • Use Case: Imagine you are developing a Qt 6 application. Use this Skill to configure your project with modern CMake practices and ensure that your code is compatible with the Qt 6 SDK.

Quick Start

Generate a CMakeLists.txt for a new Qt 6 project and configure the project to include a QML module named 'MyApp'.

Frequently Asked Questions about qt-cmake-project

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a Qt 6 CMake project correctly?▼

To set up a Qt 6 CMake project, you need a correct top-level CMakeLists.txt layout that avoids legacy qmake and qt5_* macros, ensuring compliance with modern Qt 6 CMake API standards and best practices.

How do I edit CMakeLists.txt to add sources and resources in Qt 6?▼

Editing CMakeLists.txt to add sources, resources, or define targets in Qt 6 involves preserving existing styles where appropriate while applying guidelines that correct common mistakes during CMake code generation.

Does AI coding assistant support Qt 6 CMake API for generating project files?▼

Yes, AI coding assistants like Claude Code and GitHub Copilot support Qt 6 CMake API by generating or updating project files, editing CMakeLists.txt, and defining targets while implementing guardrails to prevent common mistakes.

What is the best way to manage static resources in a Qt CMake project?▼

The best way to manage static resources in a Qt CMake project is by following specific guidance for organizing images, icons, fonts, and translations, ensuring they are correctly defined within your CMake targets.

Why does my Qt 6 CMake project fail when using legacy qmake macros?▼

Qt 6 CMake projects fail with legacy qmake or qt5_* macros because they do not comply with modern Qt 6 CMake API standards; updating to modern CMake practices ensures compatibility with the Qt 6 SDK.

Can I query Qt documentation for CMake command signatures directly?▼

Yes, you can query Qt documentation for CMake command signatures, with instructions provided for looking up command signatures directly and falling back to web documentation when necessary.