BUG: Drop build-machine paths from the installed gdcmConfigure.h - #6877
Merged
hjmjohnson merged 1 commit intoSep 21, 2026
Merged
hjmjohnson merged 1 commit into
hjmjohnson merged 1 commit into
Conversation
hjmjohnson
marked this pull request as ready for review
September 20, 2026 21:36
Contributor
|
hjmjohnson
force-pushed
the
bug-gdcm-drop-buildpath-macros
branch
2 times, most recently
from
September 20, 2026 22:22
cc929a1 to
33bfda3
Compare
The installed header recorded the build machine's source and output directories, and configure_file does not evaluate the generator expression that CMAKE_RUNTIME_OUTPUT_DIRECTORY carries in a wrapping build, so two of the macros held literal $<1:...> text. The macros have no reader in an ITK build: gdcmTesting.cxx compiles only under GDCM_BUILD_TESTING, the GDCM_SOURCE_DIR use in gdcmGlobal.cxx sits behind the same guard, and a non-standalone GDCM forces that option off. A BEGIN ITK / END ITK block keeps the upstream lines in place under #if 0 so a later update conflicts on recognizable text. Each opening substitution token is broken, since configure_file expands them inside a disabled block as readily as anywhere else.
hjmjohnson
force-pushed
the
bug-gdcm-drop-buildpath-macros
branch
from
September 21, 2026 10:35
33bfda3 to
d358549
Compare
Member
Author
|
@greptileai please re-review — the patch now keeps the upstream lines under |
dzenanz
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An installed ITK carried the build machine's source and output directories in the public header
include/ITK-6.0/gdcmConfigure.h, two of them holding an unevaluated generator expression. Dropping the three macros leaves an install tree with no reference to the machine that produced it. Fixes #6876.What the installed header contained
CMake/WrappingConfigCommon.cmakewraps the output directory in a generator expression so multi-config generators do not append a per-config subdirectory.configure_filedoes not evaluate generator expressions, so$<1:...>reached the installed header as literal text and the last two macros did not name a real directory on any machine.Why removing them is safe
GDCM_EXECUTABLE_OUTPUT_PATHandGDCM_LIBRARY_OUTPUT_PATHhave no reference anywhere outside the template that defines them.GDCM_SOURCE_DIRdoes have consumers, so the reason it can go is different:gdcmTesting.cxxis added to the source list only underif(GDCM_BUILD_TESTING), and theGDCM_SOURCE_DIRuse ingdcmGlobal.cxxsits inside#ifdef GDCM_BUILD_TESTING.Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt:495setsGDCM_BUILD_TESTING OFFfor a non-standalone GDCM, which is always ITK's case, so neither consumer is ever compiled here.This patches vendored third-party source, as 4aec5d1 did for this same file.
Verification
Measured on a real install rather than by inspection.
include/ITK-6.0/gdcmConfigure.hGDCM_*path macros in the installed headerctest -R "GDCM|gdcm"— 103/103 passed.gdcmCommon,gdcmDICT,gdcmDSED,gdcmMSFF,ITKIOGDCMrebuilt: 0 warnings, 0 errors.pre-commit run --all-files— exit 0.Remaining, not addressed here
After this change
include/ITK-6.0/vcl_where_root_dir.his the only file in a clean install that names a path on the build machine, viaVCL_SOURCE_ROOT_DIR. It is a separate concern in vendored VXL with a different shape, since its consumer is compiled unconditionally, and it belongs in its own change against the VXL fork.