Problem 2589 - geant4-config outputs incorrect include paths for macOS Framework builds of Qt
Summary: geant4-config outputs incorrect include paths for macOS Framework builds of Qt
Status: CLOSED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: cmake (show other problems)
Version: 11.2
Hardware: All Mac OS X
: P4 minor
Assignee: Ben Morgan
URL:
Depends on:
Blocks:
 
Reported: 2024-01-23 14:02 CET by Ben Morgan
Modified: 2024-04-17 15:37 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.