G4GDMLRead.hh does not see XercesC

_Geant4 Version: 10.4.3
_Operating System: macOS Sonoma 14.5
_Compiler/Version: Apple clang 15.0
_CMake Version: 3.25.1


I’m trying to enable the gdml reader in Geant4 v10.4.3.
I’ve installed the Xerces-C version 3.2.5 through homebrew, and I give the CMake command in the build directory of geant4 specifying the path where to find Xerces as:

cmake
-DCMAKE_INSTALL_PREFIX="/.../geant4/geant4-v10.4.3-install" 
-DCMAKE_BUILD_TYPE=RelWithDebInfo 
-DGEANT4_USE_GDML=ON 
-DGEANT4_BUILD_MULTITHREADED=OFF 
-DXERCESC_ROOT_DIR=/opt/homebrew/Cellar/xerces-c/3.2.5 
 ../geant4-v10.4.3

However, when coding my detectorconstruction including the “G4GDMLParser.hh”, the code editor (I’m using visual studio) tells me that in G4GDMLRead.hh all the include to the xercesc headers are not finding the path.

Opening also the CMakeCache.txt in the build directory this is what I find:

//Path to a file.
XERCESC_INCLUDE_DIR:PATH=/opt/homebrew/include

//Path to a library.
XERCESC_LIBRARY:FILEPATH=/opt/homebrew/lib/libxerces-c.dylib

//No help, variable specified on the command line.
XERCESC_ROOT_DIR:UNINITIALIZED=/opt/homebrew/Cellar/xerces-c/3.2.5

How can I solve it?

Could you post the error message here please, and also the full compile command that causes the error (run make VERBOSE=1).

Bear in mind that 10.4.3 is extremely old and we can’t guarantee functionality on the latest systems. Unless you have a very good reason to pick 10.4.3, I’d strongly suggest using the latest 11.2 version.

Sorry for the late reply.
In the end the problem seemed to be only in the workspace of visual studio, while compiling and linking everything it seems to work fine.