Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Modules/ThirdParty/GoogleTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ if(NOT ITK_BINARY_DIR)
set(GTEST_ROOT \"${GTEST_ROOT}\")
find_package(GTest REQUIRED)
endif()
"
)
set(
ITKGoogleTest_EXPORT_CODE_INSTALL
"
set(GTEST_ROOT \"${GTEST_ROOT}\")
find_package(GTest REQUIRED)
"
)
Comment on lines +16 to 22

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Install-tree GoogleTest export is omitted for a valid system source root

When ITK_USE_SYSTEM_GOOGLETEST=ON and GTEST_ROOT points to a GoogleTest source directory containing CMakeLists.txt, the condition at line 5 is false and this install export code is never emitted. The installed module then does not restore GTest::gtest and GTest::gtest_main; consequently, downstream projects that use CreateGoogleTestDriver fail to configure because those targets are missing. Emit the install-side find_package(GTest REQUIRED) export for both system-GTest branches.

Artifacts

CMake install-tree reproduction harness source

  • The executable shell harness creates a valid fake GTest source root and package, installs a producer, and configures/builds an independent consumer; it is the exact source used for both captured runs.

Consumer configure failure with valid GTest source root

  • The repository's exact module file was installed and consumed with `GTEST_ROOT` containing `CMakeLists.txt`; CMake failed because `GTest::gtest` was not found, confirming the broken install export path.

Consumer configure and build success after test-only export relocation

  • A temporary test-only variant emits the install export outside the source-root condition; the consumer found GTest, built `consumer_driver`, and exited successfully, demonstrating the repair.

View artifacts

T-Rex Ran code and verified through T-Rex

endif()
Expand Down
Loading