From 6a3aabf772cd6f8b0c9d6bbdf2d0e071e7a94f6e Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Wed, 1 Jul 2026 12:48:54 +0200 Subject: [PATCH] Allow disabling of GDML so there is no dependency on xerces-c --- README.md | 1 + superbuild/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0634da7..dfdafa0 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ After the build, the executables are at `build/run_pbwo4` and `build/run_samplin | CMake option | Default | Meaning | |---|---|---| | `GEANT4_INSTALL_DATA` | `ON` | Download Geant4 physics data tables (~2 GB) | +| `GEANT4_USE_GDML` | `ON` | Build Geant4 with GDML support (requires Xerces-C); set `OFF` to build without Xerces-C | The superbuild caps parallelism at `min(nproc, 16)` to avoid memory exhaustion. diff --git a/superbuild/CMakeLists.txt b/superbuild/CMakeLists.txt index 4d58e14..5454a5d 100644 --- a/superbuild/CMakeLists.txt +++ b/superbuild/CMakeLists.txt @@ -18,6 +18,7 @@ set(G4_SRC ${CMAKE_SOURCE_DIR}/../lib/geant4) set(MINI_SRC ${CMAKE_SOURCE_DIR}/..) option(GEANT4_INSTALL_DATA "Download Geant4 physics data files (~2 GB)" ON) +option(GEANT4_USE_GDML "Build Geant4 with GDML support (requires Xerces-C)" ON) # ── Geant4 ──────────────────────────────────────────────────────────────────── ExternalProject_Add(geant4 @@ -28,7 +29,7 @@ ExternalProject_Add(geant4 -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=Release -DGEANT4_INSTALL_DATA=${GEANT4_INSTALL_DATA} - -DGEANT4_USE_GDML=ON + -DGEANT4_USE_GDML=${GEANT4_USE_GDML} -DGEANT4_BUILD_MULTITHREADED=OFF -DGEANT4_BUILD_TLS_MODEL=global-dynamic BUILD_COMMAND cmake --build --parallel ${NPROC}