Commit db0fcf2
committed
COMP: Build in-scope DCMTK alongside MINC and GDCM on MSVC
Building DCMTK in ITK's shared CMake scope (FetchContent + add_subdirectory)
runs DCMTK's configure in that scope, with two side effects on sibling
third-party modules:
- Leftover CMAKE_REQUIRED_* state from DCMTK's probes. Snapshot and restore it
around FetchContent_MakeAvailable(dcmtk).
- DCMTK's GenerateDCMTKConfigure.cmake globally redefines standard CMake check
commands (CHECK_FUNCTION_EXISTS on Windows, CHECK_CXX_SYMBOL_EXISTS). CMake
commands are global, so those overrides leak into ITK modules configured
afterward: their CHECK_FUNCTION_EXISTS calls run DCMTK's header-less
check_symbol_exists, report the function missing, and the module trips a
#error -- MINC on tmpnam, GDCM on _strnicmp, depending on configure order.
Restore the real implementations after DCMTK by including a copy of each
module under a fresh path (include_guard(GLOBAL) blocks a plain re-include),
fixing every dependent module regardless of order.
The ExternalProject build never hit either because DCMTK configures in a
separate CMake process.1 parent 5003c3e commit db0fcf2
1 file changed
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
270 | 286 | | |
271 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
272 | 312 | | |
273 | 313 | | |
274 | 314 | | |
| |||
0 commit comments