Qt6CoreConfig.cmake missing on Mac

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

Geant4 Version: 11.4.0
Operating System: MacOS 26.2 (Tahoe)
Compiler/Version: clang 17.0.0
CMake Version: 3.30.0


I’m trying install geant4 on and M1 Mac. I use homebrew as an installer and all packages have been fully updated.

I was able to successfully build and install geant4 by explicitly pointing to the Qt6 directory, but when I try to build this examples, I get the following error:

Could not find a package configuration file provided by “Qt6Core” with any
of the following names:

Qt6CoreConfig.cmake
qt6core-config.cmake

These files are not in the standard qt cmake area and I can’t find them anywhere on my computer.
Any help would be appreciated.

Caveat that I’m still on Sequoia, but Qt6CoreConfig.cmake should be present at:

/opt/homebrew/lib/cmake/Qt6Core/Qt6CoreConfig.cmake

and certainly at

/opt/homebrew/Cellar/qtbase/6.10.1/lib/cmake/Qt6Core/Qt6CoreConfig.cmake

Do you have those present? If not, what does brew ls print?

If you successfully built G4 itself against Qt6 (as I was able to), then we know that G4’s CMake can find it. For the examples, you may need to use the same CMake option you used with G4 itself, something like -DCMAKE_PREFIX_PATH=/opt/homebrew/Cellar/qt (or whatever it is on your system, use brew ls Qt6 as Ben suggested). The examples do not inherit your G4 CMake setup, they’re independent “projects”.