Problem 2303

Summary: Building Geant4 with Qt fails with CMake 3.8 due to missing AUTOMOC paths
Product: Geant4 Reporter: Ben Morgan <Ben.Morgan>
Component: cmakeAssignee: Ben Morgan <Ben.Morgan>
Status: CLOSED FIXED    
Severity: minor    
Priority: P4    
Version: 10.7   
Hardware: All   
OS: All   

Description Ben Morgan 2020-12-17 18:00:37 CET
As reported on Discourse, and confirmed:

https://geant4-forum.web.cern.ch/t/opengl-cmake-automoc-problem/4128

Geant4 10.7 will fail to build Qt modules (OpenGL etc) due to Automoc (CMake Autogen) failing to pick up required Geant4 headers. This appears to be due to a bug in CMake 3.8, or missing configuration in Geant4 for this CMake version. Whilst investigation continues, there are two possible patches:

1. Use CMake 3.9 or newer, where this problem appears resolved
2. Copy the offending headers from the `include` directories to the corresponding `src` directory for the module. This does not affect the build otherwise (`include` has priority over `src`) and resolves the issue.

A permanent fix will be investigated.
Comment 1 Ben Morgan 2021-01-26 11:12:23 CET
Patch made on development master, back ported to 10.7 patches so will be in 10.7.1 release. Resolution is to require CMake 3.9 or newer with Qt.