Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Include find GTest CMake code when installed #4966

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blowekamp
Copy link
Member

May address: #303

PR Checklist

  • No API changes were made (or the changes have been approved)
  • No major design changes were made (or the changes have been approved)
  • Added test (or behavior not changed)
  • Updated API documentation (or API not changed)
  • Added license to new files (if any)
  • Added Python wrapping to new files (if any) as described in ITK Software Guide Section 9.5
  • Added ITK examples for all new major features (if any)

Refer to the ITK Software Guide for
further development details if necessary.

@github-actions github-actions bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:ThirdParty Issues affecting the ThirdParty module labels Nov 20, 2024
@blowekamp
Copy link
Member Author

The GTest libraries should not be a build time dependency of an installed ITK, but not sure how to disable the GTest libraries in an installed ITK.

@dzenanz dzenanz requested a review from bradking November 20, 2024 21:27
@@ -10,6 +10,10 @@ 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}\")
Copy link
Member

Choose a reason for hiding this comment

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

The install tree is relocatable so we shouldn't set GTEST_ROOT since GTest might not be in the same place after deployment.

@bradking
Copy link
Member

not sure how to disable the GTest libraries in an installed ITK.

One needs to make sure nothing depends on them publicly. Then they shouldn't need to be installed.

@blowekamp
Copy link
Member Author

not sure how to disable the GTest libraries in an installed ITK.

One needs to make sure nothing depends on them publicly. Then they shouldn't need to be installed.

In all "itk-module.cmake" files, if used, it is under "TEST_DEPENDS".

@bradking
Copy link
Member

Off the top of my head I don't see why TEST_DEPENDS in the build tree should affect requirements in the install tree, at least conceptually.

Even if GTest is not an exported public or private dependency it may
still be used by application if all the ITK modules are selected for
use.
Copy link
Member

@hjmjohnson hjmjohnson left a comment

Choose a reason for hiding this comment

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

This seems reasonable to me.

@hjmjohnson hjmjohnson self-requested a review December 13, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:ThirdParty Issues affecting the ThirdParty module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants