Skip to content

Configuration - Validate the configuration on CMake 3.10 and later#762

Merged
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:cmake_3_10_checkup
Oct 25, 2025
Merged

Configuration - Validate the configuration on CMake 3.10 and later#762
dpasukhi merged 2 commits intoOpen-Cascade-SAS:IRfrom
dpasukhi:cmake_3_10_checkup

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

  • adm/cmake/gtest.cmake: check CMake version before using FetchContent; emit a warning and skip FetchContent-based GoogleTest setup when CMake < 3.11.
  • adm/cmake/occt_macros.cmake: wrap list(REMOVE_DUPLICATES ...) calls in if() checks to avoid operating on empty/unset variables.

- adm/cmake/gtest.cmake: check CMake version before using FetchContent; emit a warning and skip FetchContent-based GoogleTest setup when CMake < 3.11.
- adm/cmake/occt_macros.cmake: wrap list(REMOVE_DUPLICATES ...) calls in if() checks to avoid operating on empty/unset variables.
@dpasukhi dpasukhi added this to the Release 8.0 milestone Oct 25, 2025
@dpasukhi dpasukhi requested a review from Copilot October 25, 2025 12:19
@dpasukhi dpasukhi self-assigned this Oct 25, 2025
@dpasukhi dpasukhi added 2. Enhancement New feature or request 1. Configuration CMake/QMake processes of OCCT or samples labels Oct 25, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances CMake configuration compatibility by adding safeguards for older CMake versions and preventing errors when operating on empty lists.

  • Adds version check to prevent FetchContent usage on CMake versions below 3.11
  • Protects list(REMOVE_DUPLICATES) operations from failing on empty/unset variables

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
adm/cmake/gtest.cmake Validates CMake version before attempting FetchContent-based GoogleTest setup
adm/cmake/occt_macros.cmake Guards list deduplication operations to handle empty variables safely

Comment thread adm/cmake/occt_macros.cmake Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Pasukhin Dmitry <pasuhinsvzn@gmail.com>
@dpasukhi dpasukhi merged commit 190c90c into Open-Cascade-SAS:IR Oct 25, 2025
23 checks passed
@dpasukhi dpasukhi deleted the cmake_3_10_checkup branch October 25, 2025 14:49
@github-project-automation github-project-automation bot moved this from Todo to Done in Maintenance Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Configuration CMake/QMake processes of OCCT or samples 2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants