Refactor wrapping to use target properties and address bug building remote modules against an ITK build directory#5842
Conversation
|
Sorry for short message, issue mostly redundant include with ITK_INCLUDE_DIRS, and target's transitive properties. Needed to keep ITK_INCLUDE_DIRS because of itkMeshRegion.h in Core/Common. The extra inc files are redundant. |
a643386 to
7722e15
Compare
| @@ -1,3 +1,4 @@ | |||
| set(ITK_MODULE_ITKCommon_WRAPPING_DEPENDS ITK::ITKMeshModule) | |||
There was a problem hiding this comment.
@thewtex There needs to be a way to express that the wrapping for common depends on the Mesh module, or the mesh code needs to be moved to a better place. This follows the convention of (internal?) variable used in ModuleMacro... I wasn't sure if other models had un-described dependencies for wrapping, but it appears not. I am still pondering better ways to specify this for wrapping; I am open to suggestions?
There was a problem hiding this comment.
Yes, I don't recall the history or the reason for this. Maybe we can ask an agent to try to simplify the dependencies?
There was a problem hiding this comment.
I have asked my local agent many questions regarding the wrapping code it figure things out. I ended up just hard coding the dep in the TypedefMacros.cmake file. Perhaps this can be revisited after this is merged and remotes are working again for wrapping.
There was a problem hiding this comment.
Apparently, it has been there since pre-modularization before 2011, and it was trivial to relocate.
7722e15 to
12250d9
Compare
| set( | ||
| CONFIG_CASTXML_INC_CONTENTS | ||
| "${CONFIG_CASTXML_INC_CONTENTS}$<LIST:JOIN,$<LIST:TRANSFORM,$<TARGET_PROPERTY:${_depend},INTERFACE_COMPILE_DEFINITIONS>,REPLACE,^(.+)$,\"-D\\1\">,\n>\n" | ||
| ) |
|
Cool! 😎 I recall that we had code to remove redundant include directories -- hopefully this helps with that, too. |
Moves MeshRegion wrapping from ITKCommon to ITKMesh module and removes the workaround dependency linkage in TypedefMacros.cmake. Related to PR InsightSoftwareConsortium#5842
Changes VTK Bridge module dependency from PRIVATE_DEPENDS to DEPENDS for ITKCommon, making it a public dependency as required. Related to PR InsightSoftwareConsortium#5842
846da46 to
9176640
Compare
9176640 to
786e51d
Compare
786e51d to
6d469c8
Compare
|
/azp.run ITK.macOS.Python |
6d469c8 to
12d1e58
Compare
|
I don't think any of the current test failures and build issue are related to this PR. |
12d1e58 to
9ecba99
Compare
|
@thewtex All the builds came back green, shall we merged this change with the wrapping infrastructure? |
|
@dzenanz CDash has been hanging. Do you know if there is a problem with the server? |
|
I am not aware of any problems. Maybe this CDash GHA check got broken somehow? |
thewtex
left a comment
There was a problem hiding this comment.
@blowekamp awesome!!
Yes, let's merge. Could you please change the base to release?
I need to re-build the Python packages with the Windows patch, and I will include this one, too. Are there others that we need to include?
There are 3 other PR's that are link to this one that did minor fixes needed #5850 #5851 #5852. So this make the rebase onto release a little more difficult. ADDITION: I think the best course of action would the to rebase this onto release. Then merge into release even though the branch is missing those components listed. This will allow testing in main. Then you can cherry pick the listed PRs, and merge this brach into release? Or just do another tag, but there still seems to be a bit of churn with other issues. Please let me know how to proceed. |
Use generator expression to convert target property into properly formatted string for include file. Change to file with GENERATE option to support generator expressions. There were redundant calls to configure the inc file for each wrapping file. An additional prefix is added to the inc file to create multiple.
Compile definitions and include directories are no longer obtained from the directory. This is replaced by usage of target level properties. Retain support for WRAPPER_LIBRARY_INCLUDE_DIRECTORIES and WRAPPER_LIBRARY_LINK_LIBRARIES to control behavior.
For modules that use Python.h, explicitly include Python's path for cast xml.
9ecba99 to
d63f5df
Compare
a322c2d
into
InsightSoftwareConsortium:main
|
@blowekamp ok, thanks. I will cherry-pick all four patches on |
Moves MeshRegion wrapping from ITKCommon to ITKMesh module and removes the workaround dependency linkage in TypedefMacros.cmake. Related to PR #5842
Changes VTK Bridge module dependency from PRIVATE_DEPENDS to DEPENDS for ITKCommon, making it a public dependency as required. Related to PR #5842
|
Backported to |
…tSoftwareConsortium#6191) PR InsightSoftwareConsortium#5842 introduced $<LIST:JOIN,$<LIST:TRANSFORM,…>> generator expressions in itk_auto_load_submodules.cmake. Those operators landed in CMake 3.27 (2023-07) but ITK's cmake_minimum_required is 3.22.1; on older CMake they silently expand to empty at file(GENERATE) time, producing castxml.inc files with no -I/-isystem/-D flags and breaking Python wrapping. Rewrite the three affected sites with $<JOIN:list,glue> (CMake 3.0+), carrying the per-element wrapping in the glue string and guarded by $<$<BOOL:property>:…> so an empty property emits nothing. Generated castxml.inc bytes are byte-identical to the 3.27+ form for both populated and empty target properties. Revert when ITK's CMake floor reaches 3.27 (block comment marks the lines).
…tSoftwareConsortium#6191) PR InsightSoftwareConsortium#5842 introduced $<LIST:JOIN,$<LIST:TRANSFORM,…>> generator expressions in itk_auto_load_submodules.cmake. Those operators landed in CMake 3.27 (2023-07) but ITK's cmake_minimum_required is 3.22.1; on older CMake they silently expand to empty at file(GENERATE) time, producing castxml.inc files with no -I/-isystem/-D flags and breaking Python wrapping. Rewrite the three affected sites with $<JOIN:list,glue> (CMake 3.0+), carrying the per-element wrapping in the glue string and guarded by $<$<BOOL:property>:…> so an empty property emits nothing. Generated castxml.inc bytes are byte-identical to the 3.27+ form for both populated and empty target properties. Revert when ITK's CMake floor reaches 3.27 (block comment marks the lines).
Use generator expression to convert target property into properly formatted string for include file. Change to file with GENERATE option to support generator expressions.
There were redundant calls to configure the inc file for each wrapping file. An additional prefix is added to the inc file to create multiple.
This addresses a bug where remote modules could not be wrapped against a build ITK due to missing include paths and definitions.
COMPATIBILITY NOTE: Removes support for directory level properties for includes and defines.
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.