brew install node
在macOS上安装OpenGL通常涉及到安装一些依赖库,如MGL、GLUT或者是GLEW等,同时确保LLVM的OpenGL框架和相关工具链的兼容性。以下是一个基本的安装步骤,你可以在终端中执行:
./configure
cmake —build . —parallel
/Volumes/MacOS/Program/qt6.2.0/qtbase/src/plugins/platforms/cocoa/CMakeLists.txt
# Generated from cocoa.pro.
# special case:
#####################################################################
## QCocoaIntegrationPlugin Plugin:
#####################################################################
# 找到 OpenGL 库
find_package(OpenGL REQUIRED)
qt_internal_add_plugin(QCocoaIntegrationPlugin
OUTPUT_NAME qcocoa
DEFAULT_IF ${QT_QPA_DEFAULT_PLATFORM} MATCHES cocoa # special case
PLUGIN_TYPE platforms
SOURCES
main.mm
qcocoaapplication.h qcocoaapplication.mm
qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm
qcocoabackingstore.h qcocoabackingstore.mm
qcocoaclipboard.h qcocoaclipboard.mm
qcocoacolordialoghelper.h qcocoacolordialoghelper.mm
qcocoacursor.h qcocoacursor.mm
qcocoadrag.h qcocoadrag.mm
qcocoaeventdispatcher.h qcocoaeventdispatcher.mm
qcocoafiledialoghelper.h qcocoafiledialoghelper.mm
qcocoafontdialoghelper.h qcocoafontdialoghelper.mm
qcocoahelpers.h qcocoahelpers.mm
qcocoainputcontext.h qcocoainputcontext.mm
qcocoaintegration.h qcocoaintegration.mm
qcocoaintrospection.h qcocoaintrospection.mm
qcocoamenu.h qcocoamenu.mm
qcocoamenubar.h qcocoamenubar.mm
qcocoamenuitem.h qcocoamenuitem.mm
qcocoamenuloader.h qcocoamenuloader.mm
qcocoamimetypes.h qcocoamimetypes.mm
qcocoanativeinterface.h qcocoanativeinterface.mm
qcocoansmenu.h qcocoansmenu.mm
qcocoascreen.h qcocoascreen.mm
qcocoaservices.h qcocoaservices.mm
qcocoasystemtrayicon.h qcocoasystemtrayicon.mm
qcocoatheme.h qcocoatheme.mm
qcocoawindow.h qcocoawindow.mm
qcocoawindowmanager.h qcocoawindowmanager.mm
qiosurfacegraphicsbuffer.h qiosurfacegraphicsbuffer.mm
qmacclipboard.h qmacclipboard.mm
qmultitouch_mac.mm qmultitouch_mac_p.h
qnsview.h qnsview.mm
qnswindow.h qnswindow.mm
qnswindowdelegate.h qnswindowdelegate.mm
qcocoacolordialoghelper.h qcocoacolordialoghelper.mm
qcocoafiledialoghelper.h qcocoafiledialoghelper.mm
qcocoafontdialoghelper.h qcocoafontdialoghelper.mm
DEFINES
QT_NO_FOREACH
LIBRARIES
${FWAppKit}
${FWCarbon}
${FWCoreServices}
${FWCoreVideo}
${FWIOKit}
${FWIOSurface}
${FWMetal}
${FWQuartzCore}
Qt::Core
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
OpenGL::GL # 添加 OpenGL 库链接
)
# special case begin
qt_disable_apple_app_extension_api_only(QCocoaIntegrationPlugin)
# special case end
# Resources:
set(qcocoaresources_resource_files
"images/sizeallcursor.png"
"images/spincursor.png"
"images/waitcursor.png"
)
qt_internal_add_resource(QCocoaIntegrationPlugin "qcocoaresources"
PREFIX
"/qt-project.org/mac/cursors"
FILES
${qcocoaresources_resource_files}
)
#### Keys ignored in scope 1:.:.:cocoa.pro:
# OTHER_FILES = "cocoa.json"
## Scopes:
#####################################################################
qt_internal_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_opengl
SOURCES
qcocoaglcontext.h qcocoaglcontext.mm
LIBRARIES
OpenGL::GL # 添加OpenGL库
)
qt_internal_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_vulkan
SOURCES
qcocoavulkaninstance.h qcocoavulkaninstance.mm
LIBRARIES
OpenGL::GL # 添加OpenGL库
)
qt_internal_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_accessibility
SOURCES
qcocoaaccessibility.h qcocoaaccessibility.mm
qcocoaaccessibilityelement.h qcocoaaccessibilityelement.mm
LIBRARIES
OpenGL::GL # 添加OpenGL库
)
qt_internal_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_sessionmanager
SOURCES
qcocoasessionmanager.cpp qcocoasessionmanager.h
LIBRARIES
OpenGL::GL # 添加OpenGL库
)
#### Keys ignored in scope 7:.:.:cocoa.pro:TARGET Qt::Widgets:
# QT_FOR_CONFIG = "widgets"
#### Keys ignored in scope 12:.:.:cocoa.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN:
# PLUGIN_EXTENDS = "-"
# Generated from opengl.pro.
#####################################################################
## OpenGL Module:
#####################################################################
qt_internal_add_module(OpenGL
SOURCES
qopengl2pexvertexarray.cpp qopengl2pexvertexarray_p.h
qopenglbuffer.cpp qopenglbuffer.h
qopenglcustomshaderstage.cpp qopenglcustomshaderstage_p.h
qopengldebug.cpp qopengldebug.h
qopenglengineshadermanager.cpp qopenglengineshadermanager_p.h
qopenglengineshadersource_p.h
qopenglframebufferobject.cpp qopenglframebufferobject.h qopenglframebufferobject_p.h
qopenglgradientcache.cpp qopenglgradientcache_p.h
qopenglpaintdevice.cpp qopenglpaintdevice.h qopenglpaintdevice_p.h
qopenglpaintengine.cpp qopenglpaintengine_p.h
qopenglpixeltransferoptions.cpp qopenglpixeltransferoptions.h
qopenglshadercache_p.h
qopenglshaderprogram.cpp qopenglshaderprogram.h
qopengltexture.cpp qopengltexture.h qopengltexture_p.h
qopengltextureblitter.cpp qopengltextureblitter.h
qopengltexturecache.cpp qopengltexturecache_p.h
qopengltextureglyphcache.cpp qopengltextureglyphcache_p.h
qopengltexturehelper.cpp qopengltexturehelper_p.h
qopengltextureuploader.cpp qopengltextureuploader_p.h
qopenglversionfunctions.cpp qopenglversionfunctions.h qopenglversionfunctions_p.h
qopenglversionfunctionsfactory.cpp qopenglversionfunctionsfactory.h
qopenglversionprofile.cpp qopenglversionprofile.h
qopenglvertexarrayobject.cpp qopenglvertexarrayobject.h
qopenglwindow.cpp qopenglwindow.h
qplatformbackingstoreopenglsupport.cpp qplatformbackingstoreopenglsupport.h
qtopenglglobal.h
DEFINES
QT_NO_FOREACH
QT_NO_USING_NAMESPACE
LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
PUBLIC_LIBRARIES
Qt::Core
Qt::Gui
PRIVATE_MODULE_INTERFACE
Qt::CorePrivate
Qt::GuiPrivate
)
## Scopes:
#####################################################################
qt_internal_extend_target(OpenGL CONDITION QT_FEATURE_opengles2
SOURCES
qopenglfunctions_es2.cpp qopenglfunctions_es2.h
)
qt_internal_extend_target(OpenGL CONDITION NOT QT_FEATURE_opengles2
SOURCES
qopenglfunctions_1_0.cpp qopenglfunctions_1_0.h
qopenglfunctions_1_1.cpp qopenglfunctions_1_1.h
qopenglfunctions_1_2.cpp qopenglfunctions_1_2.h
qopenglfunctions_1_3.cpp qopenglfunctions_1_3.h
qopenglfunctions_1_4.cpp qopenglfunctions_1_4.h
qopenglfunctions_1_5.cpp qopenglfunctions_1_5.h
qopenglfunctions_2_0.cpp qopenglfunctions_2_0.h
qopenglfunctions_2_1.cpp qopenglfunctions_2_1.h
qopenglfunctions_3_0.cpp qopenglfunctions_3_0.h
qopenglfunctions_3_1.cpp qopenglfunctions_3_1.h
qopenglfunctions_3_2_compatibility.cpp qopenglfunctions_3_2_compatibility.h
qopenglfunctions_3_2_core.cpp qopenglfunctions_3_2_core.h
qopenglfunctions_3_3_compatibility.cpp qopenglfunctions_3_3_compatibility.h
qopenglfunctions_3_3_core.cpp qopenglfunctions_3_3_core.h
qopenglfunctions_4_0_compatibility.cpp qopenglfunctions_4_0_compatibility.h
qopenglfunctions_4_0_core.cpp qopenglfunctions_4_0_core.h
qopenglfunctions_4_1_compatibility.cpp qopenglfunctions_4_1_compatibility.h
qopenglfunctions_4_1_core.cpp qopenglfunctions_4_1_core.h
qopenglfunctions_4_2_compatibility.cpp qopenglfunctions_4_2_compatibility.h
qopenglfunctions_4_2_core.cpp qopenglfunctions_4_2_core.h
qopenglfunctions_4_3_compatibility.cpp qopenglfunctions_4_3_compatibility.h
qopenglfunctions_4_3_core.cpp qopenglfunctions_4_3_core.h
qopenglfunctions_4_4_compatibility.cpp qopenglfunctions_4_4_compatibility.h
qopenglfunctions_4_4_core.cpp qopenglfunctions_4_4_core.h
qopenglfunctions_4_5_compatibility.cpp qopenglfunctions_4_5_compatibility.h
qopenglfunctions_4_5_core.cpp qopenglfunctions_4_5_core.h
qopenglqueryhelper_p.h
qopengltimerquery.cpp qopengltimerquery.h
LIBRARIES
OpenGL::GL # 添加 OenGL 库
)
qt_internal_extend_target(OpenGL CONDITION QT_FEATURE_vulkan
SOURCES
qvkconvenience.cpp qvkconvenience_p.h
LIBRARIES
OpenGL::GL # 添加 OenGL 库
)
if(QT_FEATURE_vulkan)
qt_internal_add_target_include_dirs_and_optionally_propagate(
OpenGL WrapVulkanHeaders::WrapVulkanHeaders)
endif()
qt_internal_extend_target(OpenGL CONDITION QT_FEATURE_egl
SOURCES
qopenglcompositor.cpp qopenglcompositor_p.h
qopenglcompositorbackingstore.cpp qopenglcompositorbackingstore_p.h
LIBRARIES
OpenGL::GL # 添加 OenGL 库
)
qt_internal_create_tracepoints(OpenGL qtopengl.tracepoints)
qt_internal_add_docs(OpenGL
doc/qtopengl.qdocconf
)
cmake —build . —parallel
In file included from ../../../3rdparty/chromium/content/public/browser/browser_accessibility_state.h:12:
../../../3rdparty/chromium/content/public/browser/browser_context.h:21:10: fatal error: 'components/spellcheck/spellcheck_buildflags.h' file not found
#include "components/spellcheck/spellcheck_buildflags.h"
文件缺失:qt-6.2.0/qtwebengine/src/3rdparty/chromium/components/spellcheck/spellcheck_buildflags.h
手工创建该文件,写入内容
#define ENABLE_SPELLCHCEK 0
#define BUILDFLAG_INTERNAL_ENABLE_SPELLCHECK 0
修改文件browser_context.h第352行如下
//#if defined(TOOLKIT_QT) && BUILDFLAG(ENABLE_SPELLCHECK)
#if defined(TOOLKIT_QT)
// Inform about not working dictionary for given language
virtual void FailedToLoadDictionary(const std::string& language) = 0;
#endif
cmake —build . —parallel
cmake --install .