Problem 2589

Summary: geant4-config outputs incorrect include paths for macOS Framework builds of Qt
Product: Geant4 Reporter: Ben Morgan <Ben.Morgan>
Component: cmakeAssignee: Ben Morgan <Ben.Morgan>
Status: CLOSED FIXED    
Severity: minor    
Priority: P4    
Version: 11.2   
Hardware: All   
OS: Mac OS X   

Description Ben Morgan 2024-01-23 14:02:21 CET
As reported on the forum: https://geant4-forum.web.cern.ch/t/qcore-qconfig-h-not-found-compiling-application-with-qt/, an application cannot be built against a Qt-enabled Geant4 on macOS that uses Qt Frameworks. Initially triaged as follows:

- Geant4 11.2 introduced beta support for Qt6, with the use of a Qt header in the public G4VisExecutive.hh/icc header for version detection. Prior to 11.2, Qt headers were only exposed in very rarely used public interfaces.
- The include paths for Qt copied into geant4-config only take the raw paths from CMake variables, which do not take account of possible use as a macOS framework (i.e. are missing a suitable `-F` flag).

There are two related fixes needed in Geant4:

1. Removal of the use of a Qt header in a commonly used public interface.
2. Correct export of Qt flags to account for possible framework use.

The workaround at present is to add Qt's main include directory (e.g. "/opt/homebrew/opt/qt@5/include" for Homebrew's install of Qt) to the compilation flags. Generally Qt should install a "standard" hierarchy of headers under this, the inclusion of which will resolve the finding of headers.
Comment 1 Ben Morgan 2024-04-17 15:37:23 CEST
Fixed upstream and in patch releases.