Hi!
I try to configure CMake with Qt5 (installed via homebrew) on my macOS Ventura 13.2 and get the following error:
Checking C++ feature CXXSTDLIB_FILESYSTEM_NATIVE - Success
CMake Error at /opt/homebrew/Cellar/qt@5/5.15.8_2/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:9 (message):
Failed to find "gl.h" in
"/System/Library/Frameworks/OpenGL.framework/Headers;/System/Library/Frameworks/AGL.framework/Headers".
Call Stack (most recent call first):
/opt/homebrew/Cellar/qt@5/5.15.8_2/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:227 (include)
/opt/homebrew/Cellar/qt@5/5.15.8_2/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package)
cmake/Modules/G4InterfaceOptions.cmake:142 (find_package)
cmake/Modules/G4CMakeMain.cmake:64 (include)
CMakeLists.txt:50 (include)
In fact, the above-mentioned headers are not there. After some googling I managed to modify the Qt5GuiConfigExtras.cmake file to point it to the direction where I could locate those header files and it seems to find all Qt related packages but it ends up in a new error:
CMake Error at /opt/homebrew/Cellar/cmake/3.25.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenGL (missing: OPENGL_INCLUDE_DIR)
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.25.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600
(_FPHSA_FAILURE_MESSAGE)
/opt/homebrew/Cellar/cmake/3.25.2/share/cmake/Modules/FindOpenGL.cmake:443 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/Modules/G4InterfaceOptions.cmake:199 (find_package)
cmake/Modules/G4CMakeMain.cmake:64 (include)
CMakeLists.txt:50 (include)
Hereby, I run the following command in my build directory:
ccmake -DCMAKE_PREFIX_PATH=/opt/homebrew/Cellar/qt@5/5.15.8_2/lib/cmake ..
Sidenote: by disabling Qt, I successfully compile Geant4 11.1.0 and run B1. However, in the vis.mac file I need to uncomment the line /vis/open/ VRML2FILE
as it otherwise complains about /vis/open OGL 600x600-0+0
since it does not find OpenGL.
I understand that it is more OS-related issue (paths to OpenGL?) rather than G4, but maybe someone had similar troubles…
Any help is much appreciated! Thanks in advance
Jurij