Opened 21 months ago

Last modified 4 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)
Port: qt5-qtbase

Description

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
    PATHS ${_GL_INCDIRS}
)
if (NOT _qt5gui_OPENGL_INCLUDE_DIR)
    message(FATAL_ERROR "Failed to find \"gl.h\" in \"${_GL_INCDIRS}\".")
endif()
unset(_GL_INCDIRS)

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

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers

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/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers")

Change History (9)

comment:1 Changed 21 months ago by jmroot (Joshua Root)

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

comment:2 Changed 21 months ago by majoc-at-astro (majoc-at-astro)

Cc: majoc-at-astro added

comment:3 Changed 21 months ago by Russell-Jones-OxPhys (Russell Jones)

Cc: Russell-Jones-OxPhys added

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

Cc: Russell-Jones-OxPhys removed

comment:5 Changed 21 months ago by Russell-Jones-OxPhys (Russell Jones)

Cc: Russell-Jones-OxPhys added

comment:6 Changed 12 months 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/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers")
 find_path(_qt5gui_OPENGL_INCLUDE_DIR gl.h
     PATHS ${_GL_INCDIRS}
 )

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 4 months 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 Xcode.app will be /Applications/Xcode.app, 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 Xcode.app is (maybe something like /Library/Developer/CommandLineTools/SDKs/…).

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

Cc: chrstphrchvz added

comment:9 Changed 4 months 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/Xcode.app, and it's Command Line Tools counterpart (if installed or present - it may not be!) is in /Library/Developer/CommandLineTools.

Note: See TracTickets for help on using tickets.