Skip to content

Prefer find_package(GTest) over FetchContent - #3

Merged
deltaeecs merged 3 commits into
masterfrom
copilot/remove-gtest-forced-integration
Dec 3, 2025
Merged

Prefer find_package(GTest) over FetchContent#3
deltaeecs merged 3 commits into
masterfrom
copilot/remove-gtest-forced-integration

Conversation

Copilot AI commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

GTest was always downloaded via FetchContent, even when system-installed. This change prefers find_package(GTest) and falls back to FetchContent only when unavailable.

Changes

  • Add find_package(GTest QUIET) before FetchContent fallback
  • Add CSR4MPI_FORCE_FETCH_GTEST option to bypass find_package when needed
  • Check both GTest_FOUND and GTEST_FOUND for compatibility with different CMake configs
  • Add DOWNLOAD_EXTRACT_TIMESTAMP TRUE to silence CMP0135 warning

Usage

# Use system GTest (default)
cmake -G Ninja ..

# Force FetchContent
cmake -G Ninja -DCSR4MPI_FORCE_FETCH_GTEST=ON ..

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

关闭对 gtest 的强行集成,优先使用 cmake 的 find_package 查找


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 3, 2025 08:31
…_GTEST option

Co-authored-by: deltaeecs <48714525+deltaeecs@users.noreply.github.com>
…lity

Co-authored-by: deltaeecs <48714525+deltaeecs@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove forced integration of gtest and use find_package instead Prefer find_package(GTest) over FetchContent Dec 3, 2025
Copilot AI requested a review from deltaeecs December 3, 2025 08:34
@deltaeecs
deltaeecs marked this pull request as ready for review December 3, 2025 08:53
@deltaeecs
deltaeecs merged commit d83e6fe into master Dec 3, 2025
2 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.

2 participants