Skip to content

chore: update cmake minimum required version in template#643

Merged
18202781743 merged 1 commit into
masterfrom
cmake-min-ver
Jul 6, 2026
Merged

chore: update cmake minimum required version in template#643
18202781743 merged 1 commit into
masterfrom
cmake-min-ver

Conversation

@BLumia

@BLumia BLumia commented Jul 2, 2026

Copy link
Copy Markdown
Member

更新 qml-app-template 中 CMakeLists.txt 要求的 CMake 版本,避免过低导致警告

Log:

Summary by Sourcery

Build:

  • Increase the cmake_minimum_required version in the qml-app-template CMakeLists.txt from 3.1 to 3.16.

@BLumia BLumia requested a review from 18202781743 July 2, 2026 02:13
@sourcery-ai

sourcery-ai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Increase the minimum required CMake version in the qml-app-template main CMakeLists to a more modern baseline to avoid warnings on newer toolchains.

Flow diagram for updated cmake_minimum_required version check

flowchart LR
    A[cMakeLists.txt] --> B(cmake_minimum_required VERSION 3.16)
    B --> C{cmake_version >= 3.16}
    C -->|yes| D[Configure project without minimum version warning]
    C -->|no| E[Fail configuration or emit error]
Loading

File-Level Changes

Change Details Files
Raise the template CMakeLists minimum required version from 3.1 to 3.16.
  • Updated cmake_minimum_required directive to require CMake 3.16 instead of 3.1
  • Left all other template variables and installation paths unchanged to keep behavior consistent aside from the version requirement
misc/qml-app-template/src/main/CMakeLists.txt

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider aligning this minimum CMake version with whatever global/project-wide minimum is defined elsewhere so templates don’t drift and create confusing inconsistencies for consumers.
  • If the template actually relies on features introduced in 3.16, it might be helpful to add a brief comment in the CMakeLists explaining why 3.16 is required to justify the bump for future maintainers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider aligning this minimum CMake version with whatever global/project-wide minimum is defined elsewhere so templates don’t drift and create confusing inconsistencies for consumers.
- If the template actually relies on features introduced in 3.16, it might be helpful to add a brief comment in the CMakeLists explaining why 3.16 is required to justify the bump for future maintainers.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码实现了CMake最低版本要求的合理提升,配置规范且无任何缺陷
语法完全正确且无安全风险,符合满分标准

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

第1行将cmake_minimum_required的版本号从3.1更新至3.16,版本号格式符合CMake语法规范,参数传递正确
建议:继续保持此种清晰的版本声明方式

  • 2.代码质量(良好)✓

变更意图明确,提升了基础构建环境的最低标准以兼容Qt 6或新版CMake特性,符合现代CMake项目规范
建议:若项目后续引入更多3.16及以上版本的现代CMake特性,建议在提交记录中补充关联的Qt版本或特性需求说明

  • 3.代码性能(无性能问题)✓

此变更为构建系统配置级别的静态声明,仅在CMake配置阶段解析一次,不影响编译产物及运行时性能
建议:无需优化

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
代码变更仅涉及构建工具的版本约束声明,不包含任何可执行逻辑、外部命令调用、路径拼接或敏感信息处理,无攻击面

  • 建议:确保CI/CD流水线及开发者的本地环境已同步升级至CMake 3.16及以上版本,避免因环境不达标导致构建失败

■ 【改进建议代码示例】

 cmake_minimum_required(VERSION 3.16)
 
 set(APP_BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin/)
 set(APP_NAME ${CMAKE_PROJECT_NAME})

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

更新 qml-app-template 中 CMakeLists.txt 要求的 CMake 版本,避免过低导致警告

Log:
@18202781743 18202781743 merged commit 348124f into master Jul 6, 2026
27 of 32 checks passed
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

Successfully merging this pull request may close these issues.

3 participants