Skip to content

BUG: Include Test depends in test directory#890

Merged
SimonRit merged 1 commit intoRTKConsortium:mainfrom
blowekamp:fix_test_deps
Jan 29, 2026
Merged

BUG: Include Test depends in test directory#890
SimonRit merged 1 commit intoRTKConsortium:mainfrom
blowekamp:fix_test_deps

Conversation

@blowekamp
Copy link
Contributor

@blowekamp blowekamp commented Jan 28, 2026

Addresses build issue with the ITK CMake interfaces library PR.

This fixes missing module dependencies in the test directory that were causing compilation errors when building with updated ITK CMake infrastructure.

The compilation error due to not being able to find the "itkTestingMacros.h" header when building tests.

InsightSoftwareConsortium/ITK#5721

@SimonRit
Copy link
Collaborator

Thanks. I don't fully understand the PR but I'll trust you on this if the CI comes green. Just a question: there is one third-party library in RTK, lpsolve55 which uses add_library instead of itk_module_add_library:
https://github.com/RTKConsortium/RTK/blob/main/utilities/lp_solve/CMakeLists.txt#L12
Is it necessary to change this for the RTK compatibility with InsightSoftwareConsortium/ITK#5721?

Addresses build issue with the ITK CMake interfaces library PR.
@blowekamp
Copy link
Contributor Author

Thanks. I don't fully understand the PR but I'll trust you on this if the CI comes green. Just a question: there is one third-party library in RTK, lpsolve55 which uses add_library instead of itk_module_add_library: https://github.com/RTKConsortium/RTK/blob/main/utilities/lp_solve/CMakeLists.txt#L12 Is it necessary to change this for the RTK compatibility with InsightSoftwareConsortium/ITK#5721?

For the use case of lpsolved, where the library is independent and does not require any of the ITK Module specified dependencies, this usage of just itk_module_target is correct. This creates an ITK::lpsolved55 interface library.

I am also noting that the ITK::RTKModule target includes the lp_solves includes not the target.
To use the more target properties based approach:

  • use target_include_directories on lpsolve55, and target_defines too with correct PUBLIC/PRIVATE.
  • add lpsolve55 to RTK_LIBRARIES variable.
  • remove lp_solve includes from the RTK_INCLUDE_DIRS variable.

You can inspect ITKTargets.cmake in the build directory to see the results.

@SimonRit SimonRit merged commit 4633893 into RTKConsortium:main Jan 29, 2026
25 checks passed
@SimonRit
Copy link
Collaborator

Thanks. I don't fully understand the PR but I'll trust you on this if the CI comes green. Just a question: there is one third-party library in RTK, lpsolve55 which uses add_library instead of itk_module_add_library: main/utilities/lp_solve/CMakeLists.txt#L12 Is it necessary to change this for the RTK compatibility with InsightSoftwareConsortium/ITK#5721?

For the use case of lpsolved, where the library is independent and does not require any of the ITK Module specified dependencies, this usage of just itk_module_target is correct. This creates an ITK::lpsolved55 interface library.

I am also noting that the ITK::RTKModule target includes the lp_solves includes not the target. To use the more target properties based approach:

* use target_include_directories on lpsolve55, and target_defines too with correct PUBLIC/PRIVATE.

* add lpsolve55 to RTK_LIBRARIES variable.

* remove lp_solve includes from the  RTK_INCLUDE_DIRS variable.

You can inspect ITKTargets.cmake in the build directory to see the results.

Thanks for your detailed answer. Can you please look into the suggestions @axel-grc?

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