Opened 4 years ago

Last modified 8 months ago

#58378 assigned defect

Qt5 CMake component fails under Xcode-10.2

Reported by: mouse07410 (Mouse) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: majoc-at-astro (majoc-at-astro), Russell-Jones-OxPhys (Russell Jones), chrstphrchvz (Christopher Chavez), cooljeanius (Eric Gallager)
Port: qt5-qtbase


MacOS Mojave 10.14.4, Xcode-10.2.1, current Macports and all the ports.

File /opt/local/libexec/qt5/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake lists paths to find gl.h file:

set(_GL_INCDIRS "/System/Library/Frameworks/OpenGL.framework/Headers" "/System/Library/Frameworks/AGL.framework/Headers")
find_path(_qt5gui_OPENGL_INCLUDE_DIR gl.h
    message(FATAL_ERROR "Failed to find \"gl.h\" in \"${_GL_INCDIRS}\".")

Under Xcode-10.2.1 this is not correct - the correct location is


So, this line in question should be changed to:

set(_GL_INCDIRS "/System/Library/Frameworks/OpenGL.framework/Headers" "/System/Library/Frameworks/AGL.framework/Headers" "/Applications/")

Change History (11)

comment:1 Changed 4 years ago by jmroot (Joshua Root)

Cc: mcalhoun@… removed
Owner: set to MarcusCalhoun-Lopez
Status: newassigned

comment:2 Changed 4 years ago by majoc-at-astro (majoc-at-astro)

Cc: majoc-at-astro added

comment:3 Changed 4 years ago by Russell-Jones-OxPhys (Russell Jones)

Cc: Russell-Jones-OxPhys added

comment:4 Changed 4 years ago by Russell-Jones-OxPhys (Russell Jones)

Cc: Russell-Jones-OxPhys removed

comment:5 Changed 4 years ago by Russell-Jones-OxPhys (Russell Jones)

Cc: Russell-Jones-OxPhys added

comment:6 Changed 3 years ago by mouse07410 (Mouse)

This problem continues. Now on Catalina 10.15.3 with Xcode-11.3.1.

Here's the patch that fixes it for the current, and presumably the future versions of Xcode:

--- /opt/local/libexec/qt5/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake.orig	2020-02-11 21:30:23.000000000 -0500
+++ /opt/local/libexec/qt5/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake	2020-02-11 21:32:59.000000000 -0500
@@ -1,7 +1,7 @@
-set(_GL_INCDIRS "/System/Library/Frameworks/OpenGL.framework/Headers" "/System/Library/Frameworks/AGL.framework/Headers")
+set(_GL_INCDIRS "/System/Library/Frameworks/OpenGL.framework/Headers" "/System/Library/Frameworks/AGL.framework/Headers" "/Applications/")
 find_path(_qt5gui_OPENGL_INCLUDE_DIR gl.h

Could the port maintainers please apply it? I understand everybody is busy, but this seems to be a simple fix to evaluate in 10 months?

comment:7 Changed 2 years ago by chrstphrchvz (Christopher Chavez)

@mouse07410, in general, improvements to MacPorts will have much better luck of being handled quickly if they are submitted as pull requests on GitHub.

I don't think MacPorts can guarantee that the location of will be /Applications/, so I don't think paths to its contents can be hardcoded exactly as suggested. Maybe MacPorts has a variable for this purpose, and/or there is a path that will be guaranteed to exist regardless of where is (maybe something like /Library/Developer/CommandLineTools/SDKs/…).

comment:8 Changed 2 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:9 Changed 2 years ago by mouse07410 (Mouse)

Based on my experience of several years, the only guarantee about Xcode one can make is that it's located in /Applications/, and it's Command Line Tools counterpart (if installed or present - it may not be!) is in /Library/Developer/CommandLineTools.

comment:10 Changed 13 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:11 Changed 8 months ago by chrstphrchvz (Christopher Chavez)

Xcode being installed to /Applications/, although typical, is not universally the case. The user is free to place Xcode wherever and then select it with sudo xcode-select -s /path/to/ A common use case is to switch between multiple Xcode versions; GitHub Actions CI offers multiple Xcode versions located in /Applications, see e.g.

Note: See TracTickets for help on using tickets.