diff --git a/.github/workflows/build-package.yaml b/.github/workflows/build-package.yaml index e834bee3..b322250f 100644 --- a/.github/workflows/build-package.yaml +++ b/.github/workflows/build-package.yaml @@ -202,7 +202,7 @@ jobs: "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify --installPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" --add Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL --add Microsoft.VisualStudio.Component.VC.14.29.16.11.CLI.Support --quiet --norestart - name: Update msbuild path - if: runner.os == 'Windows' + if: ${{ !contains(matrix.package, 'qt-6') && runner.os == 'Windows' }} uses: ilammy/msvc-dev-cmd@v1.13.0 with: toolset: 14.29 diff --git a/package-system/Qt/Dockerfile b/package-system/Qt/Dockerfile deleted file mode 100644 index 008762f3..00000000 --- a/package-system/Qt/Dockerfile +++ /dev/null @@ -1,82 +0,0 @@ - -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# - -# This docker file uses ubuntu 20.04 as the base image to install the dependencies to build Qt from source -# - -# The cpu architecture to base the docker base script from -ARG INPUT_ARCHITECTURE=amd64 - -# The root to base the docker script base from -ARG INPUT_IMAGE=ubuntu:20.04 - -# The build subfolder where the final artifacts are built in this container which will be used to copy the results out of -ARG INPUT_BUILD_FOLDER=build - -# The name of the build script to copy to the docker image to execute -ARG INPUT_DOCKER_BUILD_SCRIPT=build.sh - -# The optional environment variable for list of folders in the mapped temp folders that represent additional 3P dependent packages -ARG INPUT_DEPENDENT_PACKAGE_FOLDERS - -FROM ${INPUT_ARCHITECTURE}/${INPUT_IMAGE} - -ARG INPUT_DOCKER_BUILD_SCRIPT -ARG INPUT_BUILD_FOLDER -ARG INPUT_DEPENDENT_PACKAGE_FOLDERS - -ENV WORKSPACE=/data/workspace -ENV DOCKER_BUILD_PATH=$WORKSPACE/$INPUT_BUILD_FOLDER -ENV DOWNLOADED_PACKAGE_FOLDERS=$INPUT_DEPENDENT_PACKAGE_FOLDERS - -WORKDIR $WORKSPACE - -# Initilize apt cache -RUN DEBIAN_FRONTEND="noninteractive" apt-get update - -# Setup time zone and locale data (necessary for SSL and HTTPS packages) -RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-configuration - -RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ - dpkg-reconfigure --frontend=noninteractive locales && \ - update-locale LANG=en_US.UTF-8 - -ENV LANG=en_US.UTF-8 -ENV ENABLE_QT_WAYLAND=0 - -# Install the development packages needed to build Qt from source -RUN apt-get install -y qtbase5-dev \ - build-essential \ - perl \ - python3 \ - git \ - '^libxcb.*-dev' \ - libx11-xcb-dev \ - libglu1-mesa-dev \ - libxrender-dev \ - libxi-dev \ - libxkbcommon-dev \ - libxkbcommon-x11-dev \ - libgbm-dev \ - libxext-dev \ - libfontconfig1-dev \ - libtiff-dev \ - libwayland-dev \ - libwayland-egl1-mesa \ - libwayland-server0 \ - libgles2-mesa-dev \ - libdrm-dev - -# Prepare a target folder within the container to install the build artifacts tp -RUN mkdir -p /data/workspace/qt - -RUN git clone --single-branch --recursive --branch v5.15.1 git://code.qt.io/qt/qtwayland.git && \ - ln -s /data/workspace/qtwayland/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/qwayland-server-qt-texture-sharing-unstable-v1.h /data/workspace/qtwayland/src/compositor/qwayland-server-qt-texture-sharing-unstable-v1.h && \ - ln -s /data/workspace/qtwayland/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/wayland-qt-texture-sharing-unstable-v1-server-protocol.h /data/workspace/qtwayland/src/compositor/wayland-qt-texture-sharing-unstable-v1-server-protocol.h - -# Copy the build script specific to this Docker script in order to execute the build -COPY docker_build_qt_linux.sh /data/workspace/ diff --git a/package-system/Qt/FindQt.cmake b/package-system/Qt/FindQt.cmake index b7e3ae6b..08fd12b4 100644 --- a/package-system/Qt/FindQt.cmake +++ b/package-system/Qt/FindQt.cmake @@ -19,21 +19,23 @@ if(NOT EXISTS ${QT_PATH}) endif() # Force-set QtCore's version here to ensure CMake detects Qt's existence and allows AUTOMOC to work -set(Qt5Core_VERSION_MAJOR "5" CACHE STRING "Qt's major version" FORCE) -set(Qt5Core_VERSION_MINOR "15" CACHE STRING "Qt's minor version" FORCE) -set(Qt5Core_VERSION_PATCH "2" CACHE STRING "Qt's patch version" FORCE) -mark_as_advanced(Qt5Core_VERSION_MAJOR) -mark_as_advanced(Qt5Core_VERSION_MINOR) -mark_as_advanced(Qt5Core_VERSION_PATCH) - -set(QT5_COMPONENTS +set(Qt6Core_VERSION_MAJOR "6" CACHE STRING "Qt's major version" FORCE) +set(Qt6Core_VERSION_MINOR "10" CACHE STRING "Qt's minor version" FORCE) +set(Qt6Core_VERSION_PATCH "2" CACHE STRING "Qt's patch version" FORCE) +mark_as_advanced(Qt6Core_VERSION_MAJOR) +mark_as_advanced(Qt6Core_VERSION_MINOR) +mark_as_advanced(Qt6Core_VERSION_PATCH) + +set(QT6_COMPONENTS Core Concurrent Gui LinguistTools Network OpenGL + OpenGLWidgets Svg + SvgWidgets Test Widgets Xml @@ -41,47 +43,42 @@ set(QT5_COMPONENTS include(${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/Qt_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) -list(APPEND CMAKE_PREFIX_PATH ${QT_LIB_PATH}/cmake/Qt5) +list(APPEND CMAKE_PREFIX_PATH ${QT_LIB_PATH}/cmake/Qt6) # Clear the cache for found DIRs -unset(Qt5_DIR CACHE) -foreach(component ${QT5_COMPONENTS}) - unset(Qt5${component}_DIR CACHE) +unset(Qt6_DIR CACHE) +foreach(component ${QT6_COMPONENTS}) + unset(Qt6${component}_DIR CACHE) endforeach() -unset(Qt5Positioning_DIR CACHE) -unset(Qt5PrintSupport_DIR CACHE) -unset(Qt5Qml_DIR CACHE) -unset(Qt5QmlModels_DIR CACHE) -unset(Qt5Quick_DIR CACHE) - -# Populate the Qt5 configurations -find_package(Qt5 - COMPONENTS ${QT5_COMPONENTS} + +# Populate the Qt6 configurations +find_package(Qt6 + COMPONENTS ${QT6_COMPONENTS} REQUIRED NO_CMAKE_PACKAGE_REGISTRY ) # Now create libraries that wrap the dependency so we can refer to them in our format -foreach(component ${QT5_COMPONENTS}) - if(TARGET Qt5::${component}) +foreach(component ${QT6_COMPONENTS}) + if(TARGET Qt6::${component}) # Convert the includes to system includes - get_target_property(system_includes Qt5::${component} INTERFACE_INCLUDE_DIRECTORIES) - set_target_properties(Qt5::${component} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "") # Clear it in case someone refers to it - ly_target_include_system_directories(TARGET Qt5::${component} + get_target_property(system_includes Qt6::${component} INTERFACE_INCLUDE_DIRECTORIES) + set_target_properties(Qt6::${component} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "") # Clear it in case someone refers to it + ly_target_include_system_directories(TARGET Qt6::${component} INTERFACE ${system_includes} ) # Alias the target with our prefix - add_library(3rdParty::Qt::${component} ALIAS Qt5::${component}) - mark_as_advanced(Qt5${component}_DIR) # Hiding from GUI + add_library(3rdParty::Qt::${component} ALIAS Qt6::${component}) + mark_as_advanced(Qt6${component}_DIR) # Hiding from GUI # Qt only has debug and release, we map the configurations we use in o3de. We map all the configurations # except debug to release foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES) string(TOUPPER ${conf} UCONF) ly_qt_configuration_mapping(${UCONF} MAPPED_CONF) - set_target_properties(Qt5::${component} PROPERTIES + set_target_properties(Qt6::${component} PROPERTIES MAP_IMPORTED_CONFIG_${UCONF} ${MAPPED_CONF} ) endforeach() @@ -90,23 +87,12 @@ foreach(component ${QT5_COMPONENTS}) endforeach() # Some extra DIR variables we want to hide from GUI -mark_as_advanced(Qt5_DIR) # Hiding from GUI -mark_as_advanced(Qt5LinguistTools_DIR) # Hiding from GUI, this variable comes from the LinguistTools module -mark_as_advanced(Qt5Positioning_DIR) -mark_as_advanced(Qt5PrintSupport_DIR) -mark_as_advanced(Qt5Qml_DIR) -mark_as_advanced(Qt5QmlModels_DIR) -mark_as_advanced(Qt5Quick_DIR) - -# Special case for Qt::Gui, we are using the private headers... -ly_target_include_system_directories(TARGET Qt5::Gui - INTERFACE "${Qt5Gui_PRIVATE_INCLUDE_DIRS}" -) - -# Another special case: Qt:Widgets, we are also using private headers -ly_target_include_system_directories(TARGET Qt5::Widgets - INTERFACE "${Qt5Widgets_PRIVATE_INCLUDE_DIRS}" -) +mark_as_advanced(Qt6_DIR) +mark_as_advanced(Qt6CoreTools_DIR) +mark_as_advanced(Qt6EntryPointPrivate_DIR) +mark_as_advanced(Qt6GuiTools_DIR) +mark_as_advanced(Qt6WidgetsTools_DIR) +mark_as_advanced(Qt6LinguistTools_DIR) # Qt plugins/translations/aux files. # We create libraries that wraps them so they get deployed properly. @@ -120,7 +106,7 @@ if(tranlation_files) OUTPUT_SUBDIRECTORY translations ) endif() -ly_add_dependencies(Qt5::Core 3rdParty::Qt::Core::Translations) +ly_add_dependencies(Qt6::Core 3rdParty::Qt::Core::Translations) # plugins, each platform will define the files it has and the OUTPUT_SUBDIRECTORY set(QT_PLUGINS @@ -130,46 +116,48 @@ set(QT_PLUGINS ) foreach(plugin ${QT_PLUGINS}) add_library(3rdParty::Qt::${plugin}::Plugins INTERFACE IMPORTED GLOBAL) - ly_add_dependencies(Qt5::${plugin} 3rdParty::Qt::${plugin}::Plugins) + ly_add_dependencies(Qt6::${plugin} 3rdParty::Qt::${plugin}::Plugins) endforeach() include(${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/QtPlugin_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +# MOC executable +unset(QT_MOC_EXECUTABLE CACHE) +find_program(QT_MOC_EXECUTABLE moc HINTS "${QT_PATH}/bin" "${QT_PATH}/libexec" REQUIRED) +mark_as_advanced(QT_MOC_EXECUTABLE) # Hiding from GUI + # UIC executable unset(QT_UIC_EXECUTABLE CACHE) -find_program(QT_UIC_EXECUTABLE uic HINTS "${QT_PATH}/bin") +find_program(QT_UIC_EXECUTABLE uic HINTS "${QT_PATH}/bin" "${QT_PATH}/libexec" REQUIRED) mark_as_advanced(QT_UIC_EXECUTABLE) # Hiding from GUI # RCC executable unset(AUTORCC_EXECUTABLE CACHE) -find_program(AUTORCC_EXECUTABLE rcc HINTS "${QT_PATH}/bin") +find_program(AUTORCC_EXECUTABLE rcc HINTS "${QT_PATH}/bin" "${QT_PATH}/libexec" REQUIRED) mark_as_advanced(AUTORCC_EXECUTABLE) # Hiding from GUI -set(Qt5Core_RCC_EXECUTABLE "${AUTORCC_EXECUTABLE}" CACHE FILEPATH "Qt's resource compiler, used by qt5_add_resources" FORCE) -mark_as_advanced(Qt5Core_RCC_EXECUTABLE) # Hiding from GUI + +# LUPDATE executable +unset(QT_LUPDATE_EXECUTABLE CACHE) +find_program(QT_LUPDATE_EXECUTABLE lupdate HINTS "${QT_PATH}/bin" "${QT_PATH}/libexec" REQUIRED) +mark_as_advanced(QT_LUPDATE_EXECUTABLE) # Hiding from GUI # LRELEASE executable unset(QT_LRELEASE_EXECUTABLE CACHE) -find_program(QT_LRELEASE_EXECUTABLE lrelease HINTS "${QT_PATH}/bin") +find_program(QT_LRELEASE_EXECUTABLE lrelease HINTS "${QT_PATH}/bin" "${QT_PATH}/libexec" REQUIRED) mark_as_advanced(QT_LRELEASE_EXECUTABLE) # Hiding from GUI -if(NOT QT_LRELEASE_EXECUTABLE) - message(FATAL_ERROR "Qt's lrelease executbale not found") -endif() -set(Qt5_LRELEASE_EXECUTABLE "${QT_LRELEASE_EXECUTABLE}" CACHE FILEPATH "Qt's lrelease executable, used by qt5_add_translation" FORCE) -mark_as_advanced(Qt5_LRELEASE_EXECUTABLE) # Hiding from GUI + +# We don't use AUTOUIC, AUTOMOC or AUTORCC from cmake +# They all use highly custom behavior which is hard to debug when things go wrong (and currently none of them work against O3DE) +# Instead we call the QT generation .exe directly as you would with any other build system +# This is easy to maintain, to understand, and easy to port #! ly_qt_uic_target: handles qt's ui files by injecting uic generation -# -# AUTOUIC has issues to detect changes in UIC files and trigger regeneration: -# https://gitlab.kitware.com/cmake/cmake/-/issues/18741 -# So instead, we are going to manually wrap the files. We dont use qt5_wrap_ui because -# it outputs to ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h and we want to follow the -# same folder structure that AUTOUIC uses -# -function(ly_qt_uic_target TARGET) - - get_target_property(all_ui_sources ${TARGET} SOURCES) +#! You are expected to include the generated ui file in your code to use the generated classes +#! Output format is "YourFolder/ui_YourFileName.h" +function(ly_qt_uic_target TARGET all_ui_sources) list(FILTER all_ui_sources INCLUDE REGEX "^.*\\.ui$") if(NOT all_ui_sources) message(FATAL_ERROR "Target ${TARGET} contains AUTOUIC but doesnt have any .ui file") + return() endif() if(AUTOGEN_BUILD_DIR) @@ -179,7 +167,6 @@ function(ly_qt_uic_target TARGET) endif() foreach(ui_source ${all_ui_sources}) - get_filename_component(filename ${ui_source} NAME_WE) get_filename_component(dir ${ui_source} DIRECTORY) if(IS_ABSOLUTE ${dir}) @@ -201,10 +188,10 @@ function(ly_qt_uic_target TARGET) set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE SKIP_AUTOUIC TRUE + SKIP_AUTORCC TRUE GENERATED TRUE ) list(APPEND all_ui_wrapped_sources ${outfile}) - endforeach() # Add files to the target @@ -230,59 +217,242 @@ endfunction() #! ly_add_translations: adds translations (ts) to a target. # -# This wrapper will generate a qrc file with those translations and add the files under "prefix" and add them to -# the indicated targets. These files will be added under the "Generated Files" filter +# Convert .ts input files into .qm files. These files are then embedded within a .qrc added as a target. +# Within the .qrc, translation files are under the "Translations" prefix. # -# \arg:TARGETS name of the targets that the translations will be added to -# \arg:PREFIX prefix where the translation will be located within the qrc file +# Additionally, this function creates a new target to update .ts files if they are missing. +# This script will be located under "scripts/translations/update_translations_yourtarget" +# +# \arg:TARGET name of the targets that the translation will be added to # \arg:FILES translation files to add # function(ly_add_translations) - set(options) - set(oneValueArgs PREFIX) - set(multiValueArgs TARGETS FILES) + set(oneValueArgs TARGET) + set(multiValueArgs FILES) cmake_parse_arguments(ly_add_translations "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # Validate input arguments - if(NOT ly_add_translations_TARGETS) - message(FATAL_ERROR "You must provide at least one target") + if(NOT ly_add_translations_TARGET) + message(FATAL_ERROR "You must provide a target") endif() if(NOT ly_add_translations_FILES) message(FATAL_ERROR "You must provide at least a translation file") endif() - qt5_add_translation(TRANSLATED_FILES ${ly_add_translations_FILES}) + if(AUTOGEN_BUILD_DIR) + set(gen_dir ${AUTOGEN_BUILD_DIR}) + else() + set(gen_dir ${CMAKE_CURRENT_BINARY_DIR}/${ly_add_translations_TARGET}_autogen/include) + endif() + + # (Optional) Allow to create or update translation files + set(stamp_file ${gen_dir}/update_translations_${ly_add_translations_TARGET}.stamp) + add_custom_command( + OUTPUT ${stamp_file} + COMMAND ${QT_LUPDATE_EXECUTABLE} + $ + -ts ${ly_add_translations_FILES} + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_EXPAND_LISTS + COMMAND ${CMAKE_COMMAND} -E touch ${stamp_file} + COMMENT "Updating translation source files for ${ly_add_translations_TARGET}" + ) + add_custom_target(update_translations_${ly_add_translations_TARGET} + DEPENDS ${stamp_file} + ) + set_target_properties( + update_translations_${ly_add_translations_TARGET} + PROPERTIES + FOLDER "scripts/translations" + ) - set(qrc_file_contents + # Generate .qm file from .ts file + set(TRANSLATED_FILES) + foreach(ts_file ${ly_add_translations_FILES}) + get_filename_component(infile ${ts_file} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_LIST_DIR}) + get_filename_component(ts_name ${infile} NAME_WE) + set(qm_file ${gen_dir}/${ts_name}.qm) + add_custom_command( + OUTPUT ${qm_file} + COMMAND ${QT_LRELEASE_EXECUTABLE} ${infile} -qm ${qm_file} + DEPENDS ${infile} + COMMENT "Generating translation ${qm_file}" + VERBATIM + ) + list(APPEND TRANSLATED_FILES ${qm_file}) + endforeach() + + # Generate qrc file + set(qrc_file_contents " - + ") + foreach(file ${TRANSLATED_FILES}) get_filename_component(filename ${file} NAME) - string(APPEND qrc_file_contents " ${filename} + string(APPEND qrc_file_contents +" ${filename} ") endforeach() - string(APPEND qrc_file_contents " + + string(APPEND qrc_file_contents +" ") - set(qrc_file_path ${CMAKE_CURRENT_BINARY_DIR}/i18n_${ly_add_translations_PREFIX}.qrc) - file(WRITE - ${qrc_file_path} - ${qrc_file_contents} - ) + set(qrc_file_path ${gen_dir}/i18n_${ly_add_translations_TARGET}.qrc) + file(WRITE ${qrc_file_path} ${qrc_file_contents}) set_source_files_properties( - ${TRANSLATED_FILES} - ${qrc_file_path} - PROPERTIES + ${TRANSLATED_FILES} + ${qrc_file_path} + PROPERTIES GENERATED TRUE SKIP_AUTORCC TRUE ) - qt5_add_resources(RESOURCE_FILE ${qrc_file_path}) - foreach(target ${ly_add_translations_TARGETS}) - target_sources(${target} PRIVATE "${TRANSLATED_FILES};${qrc_file_path};${RESOURCE_FILE}") + target_sources(${ly_add_translations_TARGET} PRIVATE ${TRANSLATED_FILES}) + ly_qt_qrc_target(${ly_add_translations_TARGET} ${qrc_file_path}) + +endfunction() + +#! ly_qt_qrc_target: handles qt's .qrc files +#! The .qrc file name that you use must be unique in your compilation module +#! You have to call Q_INIT_RESOURCE(YOUR_QRC_NAME) in a .cpp file to load it +function(ly_qt_qrc_target TARGET all_qrc_sources) + list(FILTER all_qrc_sources INCLUDE REGEX "^.*\\.qrc$") + if(NOT all_qrc_sources) + message("Target ${TARGET} contains AUTORCC but doesnt have any .qrc file") + return() + endif() + + if(AUTOGEN_BUILD_DIR) + set(gen_dir ${AUTOGEN_BUILD_DIR}) + else() + set(gen_dir ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/include) + endif() + + foreach(qrc_source ${all_qrc_sources}) + get_filename_component(filename ${qrc_source} NAME_WE) + get_filename_component(dir ${qrc_source} DIRECTORY) + if(IS_ABSOLUTE ${dir}) + file(RELATIVE_PATH dir ${CMAKE_CURRENT_SOURCE_DIR} ${dir}) + endif() + + set(outfolder ${gen_dir}/${dir}) + set(outfile ${outfolder}/qrc_resources_${filename}.cpp) + get_filename_component(infile ${qrc_source} ABSOLUTE) + + string(RANDOM _random) + file(MAKE_DIRECTORY ${outfolder}) + add_custom_command(OUTPUT ${outfile} + COMMAND ${AUTORCC_EXECUTABLE} -name ${filename} -o ${outfile} ${infile} + MAIN_DEPENDENCY ${infile} VERBATIM + COMMENT "RCC ${infile}" + ) + + set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC TRUE) + set_source_files_properties(${outfile} PROPERTIES + SKIP_AUTOMOC TRUE + SKIP_AUTOUIC TRUE + SKIP_AUTORCC TRUE + SKIP_UNITY_BUILD_INCLUSION TRUE + GENERATED TRUE + ) + list(APPEND all_qrc_wrapped_sources ${outfile}) + endforeach() + + # Add files to the target + target_sources(${TARGET} PRIVATE ${all_qrc_wrapped_sources}) + source_group("Generated Files" FILES ${all_qrc_wrapped_sources}) + + # Add include directories relative to the generated folder + # query for the property first to avoid the "NOTFOUND" in a list + get_property(has_includes TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES SET) + if(has_includes) + get_property(all_include_directories TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES) + foreach(dir ${all_include_directories}) + if(IS_ABSOLUTE ${dir}) + file(RELATIVE_PATH dir ${CMAKE_CURRENT_SOURCE_DIR} ${dir}) + endif() + list(APPEND new_includes ${gen_dir}/${dir}) + endforeach() + endif() + list(APPEND new_includes ${gen_dir}) + target_include_directories(${TARGET} PRIVATE ${new_includes}) + +endfunction() + +#! ly_qt_moc_target: handles qt's .h files by injecting moc generation +#! Detect all of your .h/.hxx files with Q_OBJECT macro. Q_OBJECT inside of .cpp files won't be catched. +#! You don't need to include the generated moc file anywhere +#! (old code might include them at the end of their .cpp, this is legacy and should be removed). +function(ly_qt_moc_target TARGET all_moc_sources) + list(FILTER all_moc_sources INCLUDE REGEX "^.*\\.(h|hxx)$") + if(NOT all_moc_sources) + message("Target ${TARGET} contains AUTOMOC but doesn't have any Q_OBJECT macro in a .h or .hxx file") + return() + endif() + + if(AUTOGEN_BUILD_DIR) + set(gen_dir ${AUTOGEN_BUILD_DIR}) + else() + set(gen_dir ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/include) + endif() + + foreach(moc_source ${all_moc_sources}) + # Skip files with no Q_OBJECT declarations + file(READ ${moc_source} TMP) + string(FIND "${TMP}" "Q_OBJECT" exist) + if(${exist} EQUAL -1) + continue() + endif() + + get_filename_component(filename ${moc_source} NAME_WE) + get_filename_component(dir ${moc_source} DIRECTORY) + if(IS_ABSOLUTE ${dir}) + file(RELATIVE_PATH dir ${CMAKE_CURRENT_SOURCE_DIR} ${dir}) + endif() + + set(outfolder ${gen_dir}/${dir}) + set(outfile ${outfolder}/moc_${filename}.cpp) + get_filename_component(infile ${moc_source} ABSOLUTE) + + file(MAKE_DIRECTORY ${outfolder}) + add_custom_command(OUTPUT ${outfile} + COMMAND ${QT_MOC_EXECUTABLE} -o ${outfile} ${infile} + MAIN_DEPENDENCY ${infile} VERBATIM + COMMENT "MOC ${infile}" + ) + + set_source_files_properties(${infile} PROPERTIES SKIP_AUTOMOC TRUE) + set_source_files_properties(${outfile} PROPERTIES + SKIP_AUTOMOC TRUE + SKIP_AUTOUIC TRUE + SKIP_AUTORCC TRUE + GENERATED TRUE + ) + list(APPEND all_moc_wrapped_sources ${outfile}) + endforeach() + # Add files to the target + target_sources(${TARGET} PRIVATE ${all_moc_wrapped_sources}) + source_group("Generated Files" FILES ${all_moc_wrapped_sources}) + + # Add include directories relative to the generated folder + # query for the property first to avoid the "NOTFOUND" in a list + get_property(has_includes TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES SET) + if(has_includes) + get_property(all_include_directories TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES) + foreach(dir ${all_include_directories}) + if(IS_ABSOLUTE ${dir}) + file(RELATIVE_PATH dir ${CMAKE_CURRENT_SOURCE_DIR} ${dir}) + endif() + list(APPEND new_includes ${gen_dir}/${dir}) + endforeach() + endif() + list(APPEND new_includes ${gen_dir}) + target_include_directories(${TARGET} PRIVATE ${new_includes}) + endfunction() diff --git a/package-system/Qt/FindQt.cmake.wayland b/package-system/Qt/FindQt.cmake.wayland deleted file mode 100644 index d50c7132..00000000 --- a/package-system/Qt/FindQt.cmake.wayland +++ /dev/null @@ -1,288 +0,0 @@ -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# -# - -if(TARGET 3rdParty::Qt::Core) # Check we are not called multiple times - return() -endif() - -set(QT_PACKAGE_NAME qt) - -set(QT_PATH "${CMAKE_CURRENT_LIST_DIR}/qt-wayland" CACHE STRING "The root path to Qt" FORCE) -mark_as_advanced(QT_PATH) -if(NOT EXISTS ${QT_PATH}) - message(FATAL_ERROR "Cannot find 3rdParty library ${QT_PACKAGE_NAME} on path ${QT_PATH}") -endif() - -# Force-set QtCore's version here to ensure CMake detects Qt's existence and allows AUTOMOC to work -set(Qt5Core_VERSION_MAJOR "5" CACHE STRING "Qt's major version" FORCE) -set(Qt5Core_VERSION_MINOR "15" CACHE STRING "Qt's minor version" FORCE) -set(Qt5Core_VERSION_PATCH "2" CACHE STRING "Qt's patch version" FORCE) -mark_as_advanced(Qt5Core_VERSION_MAJOR) -mark_as_advanced(Qt5Core_VERSION_MINOR) -mark_as_advanced(Qt5Core_VERSION_PATCH) - -set(QT5_COMPONENTS - Core - Concurrent - Gui - LinguistTools - Network - OpenGL - Svg - Test - Widgets - Xml -) - -include(${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/Qt_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) - -list(APPEND CMAKE_PREFIX_PATH ${QT_LIB_PATH}/cmake/Qt5) - -# Clear the cache for found DIRs -unset(Qt5_DIR CACHE) -foreach(component ${QT5_COMPONENTS}) - unset(Qt5${component}_DIR CACHE) -endforeach() -unset(Qt5Positioning_DIR CACHE) -unset(Qt5PrintSupport_DIR CACHE) -unset(Qt5Qml_DIR CACHE) -unset(Qt5QmlModels_DIR CACHE) -unset(Qt5Quick_DIR CACHE) - -# Populate the Qt5 configurations -find_package(Qt5 - COMPONENTS ${QT5_COMPONENTS} - REQUIRED - NO_CMAKE_PACKAGE_REGISTRY -) - -# Now create libraries that wrap the dependency so we can refer to them in our format -foreach(component ${QT5_COMPONENTS}) - if(TARGET Qt5::${component}) - - # Convert the includes to system includes - get_target_property(system_includes Qt5::${component} INTERFACE_INCLUDE_DIRECTORIES) - set_target_properties(Qt5::${component} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "") # Clear it in case someone refers to it - ly_target_include_system_directories(TARGET Qt5::${component} - INTERFACE ${system_includes} - ) - - # Alias the target with our prefix - add_library(3rdParty::Qt::${component} ALIAS Qt5::${component}) - mark_as_advanced(Qt5${component}_DIR) # Hiding from GUI - - # Qt only has debug and release, we map the configurations we use in o3de. We map all the configurations - # except debug to release - foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES) - string(TOUPPER ${conf} UCONF) - ly_qt_configuration_mapping(${UCONF} MAPPED_CONF) - set_target_properties(Qt5::${component} PROPERTIES - MAP_IMPORTED_CONFIG_${UCONF} ${MAPPED_CONF} - ) - endforeach() - - endif() -endforeach() - -# Some extra DIR variables we want to hide from GUI -mark_as_advanced(Qt5_DIR) # Hiding from GUI -mark_as_advanced(Qt5LinguistTools_DIR) # Hiding from GUI, this variable comes from the LinguistTools module -mark_as_advanced(Qt5Positioning_DIR) -mark_as_advanced(Qt5PrintSupport_DIR) -mark_as_advanced(Qt5Qml_DIR) -mark_as_advanced(Qt5QmlModels_DIR) -mark_as_advanced(Qt5Quick_DIR) - -# Special case for Qt::Gui, we are using the private headers... -ly_target_include_system_directories(TARGET Qt5::Gui - INTERFACE "${Qt5Gui_PRIVATE_INCLUDE_DIRS}" -) - -# Another special case: Qt:Widgets, we are also using private headers -ly_target_include_system_directories(TARGET Qt5::Widgets - INTERFACE "${Qt5Widgets_PRIVATE_INCLUDE_DIRS}" -) - -# Qt plugins/translations/aux files. -# We create libraries that wraps them so they get deployed properly. -# This used to be deployed through winqtdeploy/macqtdeploy, however, those tools -# are old and unmaintaned, macqtdeploy takes long times to run -add_library(3rdParty::Qt::Core::Translations INTERFACE IMPORTED GLOBAL) -file(GLOB tranlation_files ${QT_PATH}/translations/qt_*.qm) -if(tranlation_files) - ly_add_target_files(TARGETS 3rdParty::Qt::Core::Translations - FILES ${tranlation_files} - OUTPUT_SUBDIRECTORY translations - ) -endif() -ly_add_dependencies(Qt5::Core 3rdParty::Qt::Core::Translations) - -# plugins, each platform will define the files it has and the OUTPUT_SUBDIRECTORY -set(QT_PLUGINS - Network - Gui - Widgets -) -foreach(plugin ${QT_PLUGINS}) - add_library(3rdParty::Qt::${plugin}::Plugins INTERFACE IMPORTED GLOBAL) - ly_add_dependencies(Qt5::${plugin} 3rdParty::Qt::${plugin}::Plugins) -endforeach() -include(${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}/QtPlugin_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) - -# UIC executable -unset(QT_UIC_EXECUTABLE CACHE) -find_program(QT_UIC_EXECUTABLE uic HINTS "${QT_PATH}/bin") -mark_as_advanced(QT_UIC_EXECUTABLE) # Hiding from GUI - -# RCC executable -unset(AUTORCC_EXECUTABLE CACHE) -find_program(AUTORCC_EXECUTABLE rcc HINTS "${QT_PATH}/bin") -mark_as_advanced(AUTORCC_EXECUTABLE) # Hiding from GUI -set(Qt5Core_RCC_EXECUTABLE "${AUTORCC_EXECUTABLE}" CACHE FILEPATH "Qt's resource compiler, used by qt5_add_resources" FORCE) -mark_as_advanced(Qt5Core_RCC_EXECUTABLE) # Hiding from GUI - -# LRELEASE executable -unset(QT_LRELEASE_EXECUTABLE CACHE) -find_program(QT_LRELEASE_EXECUTABLE lrelease HINTS "${QT_PATH}/bin") -mark_as_advanced(QT_LRELEASE_EXECUTABLE) # Hiding from GUI -if(NOT QT_LRELEASE_EXECUTABLE) - message(FATAL_ERROR "Qt's lrelease executbale not found") -endif() -set(Qt5_LRELEASE_EXECUTABLE "${QT_LRELEASE_EXECUTABLE}" CACHE FILEPATH "Qt's lrelease executable, used by qt5_add_translation" FORCE) -mark_as_advanced(Qt5_LRELEASE_EXECUTABLE) # Hiding from GUI - -#! ly_qt_uic_target: handles qt's ui files by injecting uic generation -# -# AUTOUIC has issues to detect changes in UIC files and trigger regeneration: -# https://gitlab.kitware.com/cmake/cmake/-/issues/18741 -# So instead, we are going to manually wrap the files. We dont use qt5_wrap_ui because -# it outputs to ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h and we want to follow the -# same folder structure that AUTOUIC uses -# -function(ly_qt_uic_target TARGET) - - get_target_property(all_ui_sources ${TARGET} SOURCES) - list(FILTER all_ui_sources INCLUDE REGEX "^.*\\.ui$") - if(NOT all_ui_sources) - message(FATAL_ERROR "Target ${TARGET} contains AUTOUIC but doesnt have any .ui file") - endif() - - if(AUTOGEN_BUILD_DIR) - set(gen_dir ${AUTOGEN_BUILD_DIR}) - else() - set(gen_dir ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_autogen/include) - endif() - - foreach(ui_source ${all_ui_sources}) - - get_filename_component(filename ${ui_source} NAME_WE) - get_filename_component(dir ${ui_source} DIRECTORY) - if(IS_ABSOLUTE ${dir}) - file(RELATIVE_PATH dir ${CMAKE_CURRENT_SOURCE_DIR} ${dir}) - endif() - - set(outfolder ${gen_dir}/${dir}) - set(outfile ${outfolder}/ui_${filename}.h) - get_filename_component(infile ${ui_source} ABSOLUTE) - - file(MAKE_DIRECTORY ${outfolder}) - add_custom_command(OUTPUT ${outfile} - COMMAND ${QT_UIC_EXECUTABLE} -o ${outfile} ${infile} - MAIN_DEPENDENCY ${infile} VERBATIM - COMMENT "UIC ${infile}" - ) - - set_source_files_properties(${infile} PROPERTIES SKIP_AUTOUIC TRUE) - set_source_files_properties(${outfile} PROPERTIES - SKIP_AUTOMOC TRUE - SKIP_AUTOUIC TRUE - GENERATED TRUE - ) - list(APPEND all_ui_wrapped_sources ${outfile}) - - endforeach() - - # Add files to the target - target_sources(${TARGET} PRIVATE ${all_ui_wrapped_sources}) - source_group("Generated Files" FILES ${all_ui_wrapped_sources}) - - # Add include directories relative to the generated folder - # query for the property first to avoid the "NOTFOUND" in a list - get_property(has_includes TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES SET) - if(has_includes) - get_property(all_include_directories TARGET ${TARGET} PROPERTY INCLUDE_DIRECTORIES) - foreach(dir ${all_include_directories}) - if(IS_ABSOLUTE ${dir}) - file(RELATIVE_PATH dir ${CMAKE_CURRENT_SOURCE_DIR} ${dir}) - endif() - list(APPEND new_includes ${gen_dir}/${dir}) - endforeach() - endif() - list(APPEND new_includes ${gen_dir}) - target_include_directories(${TARGET} PRIVATE ${new_includes}) - -endfunction() - -#! ly_add_translations: adds translations (ts) to a target. -# -# This wrapper will generate a qrc file with those translations and add the files under "prefix" and add them to -# the indicated targets. These files will be added under the "Generated Files" filter -# -# \arg:TARGETS name of the targets that the translations will be added to -# \arg:PREFIX prefix where the translation will be located within the qrc file -# \arg:FILES translation files to add -# -function(ly_add_translations) - - set(options) - set(oneValueArgs PREFIX) - set(multiValueArgs TARGETS FILES) - - cmake_parse_arguments(ly_add_translations "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - # Validate input arguments - if(NOT ly_add_translations_TARGETS) - message(FATAL_ERROR "You must provide at least one target") - endif() - if(NOT ly_add_translations_FILES) - message(FATAL_ERROR "You must provide at least a translation file") - endif() - - qt5_add_translation(TRANSLATED_FILES ${ly_add_translations_FILES}) - - set(qrc_file_contents -" - -") - foreach(file ${TRANSLATED_FILES}) - get_filename_component(filename ${file} NAME) - string(APPEND qrc_file_contents " ${filename} -") - endforeach() - string(APPEND qrc_file_contents " - -") - set(qrc_file_path ${CMAKE_CURRENT_BINARY_DIR}/i18n_${ly_add_translations_PREFIX}.qrc) - file(WRITE - ${qrc_file_path} - ${qrc_file_contents} - ) - set_source_files_properties( - ${TRANSLATED_FILES} - ${qrc_file_path} - PROPERTIES - GENERATED TRUE - SKIP_AUTORCC TRUE - ) - qt5_add_resources(RESOURCE_FILE ${qrc_file_path}) - - foreach(target ${ly_add_translations_TARGETS}) - target_sources(${target} PRIVATE "${TRANSLATED_FILES};${qrc_file_path};${RESOURCE_FILE}") - endforeach() - -endfunction() diff --git a/package-system/Qt/Platform/Linux/QtPlugin_linux.cmake b/package-system/Qt/Platform/Linux/QtPlugin_linux.cmake index 7d5aecf0..d8566b66 100644 --- a/package-system/Qt/Platform/Linux/QtPlugin_linux.cmake +++ b/package-system/Qt/Platform/Linux/QtPlugin_linux.cmake @@ -7,27 +7,22 @@ # # Not plugins per-se but extra files associated to each component -foreach(component ${QT5_COMPONENTS}) - if(TARGET Qt5::${component}) +foreach(component ${QT6_COMPONENTS}) + if(TARGET Qt6::${component}) # add the IMPORTED_SONAME files as files to copy unset(extra_target_files) - get_target_property(imported_soname Qt5::${component} IMPORTED_SONAME_RELEASE) + get_target_property(imported_soname Qt6::${component} IMPORTED_SONAME_RELEASE) if(imported_soname) list(APPEND extra_target_files ${QT_LIB_PATH}/${imported_soname}) endif() if(extra_target_files) - ly_add_target_files(TARGETS Qt5::${component} FILES ${extra_target_files}) + ly_add_target_files(TARGETS Qt6::${component} FILES ${extra_target_files}) endif() endif() endforeach() -ly_add_target_files(TARGETS 3rdParty::Qt::Network::Plugins - FILES ${QT_PATH}/plugins/bearer/libqgenericbearer.so - OUTPUT_SUBDIRECTORY bearer -) - ly_add_target_files(TARGETS 3rdParty::Qt::Gui::Plugins FILES ${QT_PATH}/plugins/iconengines/libqsvgicon.so OUTPUT_SUBDIRECTORY iconengines @@ -60,5 +55,8 @@ ly_add_target_files(TARGETS 3rdParty::Qt::Gui::Plugins OUTPUT_SUBDIRECTORY xcbglintegrations ) -ly_add_dependencies(3rdParty::Qt::Widgets::Plugins Qt5::DBus) -ly_add_dependencies(3rdParty::Qt::Widgets::Plugins Qt5::XcbQpa) +ly_add_dependencies(3rdParty::Qt::Widgets::Plugins Qt6::DBus) +ly_add_target_files(TARGETS 3rdParty::Qt::Widgets::Plugins + FILES + ${QT_PATH}/lib/libQt6XcbQpa.so +) diff --git a/package-system/Qt/Platform/Linux/Qt_linux.cmake b/package-system/Qt/Platform/Linux/Qt_linux.cmake index 56b44a58..821fcde1 100644 --- a/package-system/Qt/Platform/Linux/Qt_linux.cmake +++ b/package-system/Qt/Platform/Linux/Qt_linux.cmake @@ -8,9 +8,8 @@ set(QT_LIB_PATH ${QT_PATH}/lib) -list(APPEND QT5_COMPONENTS +list(APPEND QT6_COMPONENTS DBus - XcbQpa ) function(ly_qt_configuration_mapping in_config out_config) diff --git a/package-system/Qt/Platform/Mac/QtPlugin_mac.cmake b/package-system/Qt/Platform/Mac/QtPlugin_mac.cmake index d36f155c..08109b42 100644 --- a/package-system/Qt/Platform/Mac/QtPlugin_mac.cmake +++ b/package-system/Qt/Platform/Mac/QtPlugin_mac.cmake @@ -41,6 +41,3 @@ ly_add_target_files(TARGETS 3rdParty::Qt::Widgets::Plugins FILES ${QT_PATH}/plugins/styles/libqmacstyle.dylib OUTPUT_SUBDIRECTORY styles ) - -add_dependencies(Qt5::MacExtras Qt5::PrintSupport) -add_dependencies(Qt5::MacExtras Qt5::DBus) diff --git a/package-system/Qt/Platform/Windows/QtPlugin_windows.cmake b/package-system/Qt/Platform/Windows/QtPlugin_windows.cmake index 9da60c5f..4ae93496 100644 --- a/package-system/Qt/Platform/Windows/QtPlugin_windows.cmake +++ b/package-system/Qt/Platform/Windows/QtPlugin_windows.cmake @@ -6,11 +6,6 @@ # # -ly_add_target_files(TARGETS 3rdParty::Qt::Network::Plugins - FILES ${QT_PATH}/plugins/bearer/qgenericbearer$<$:d>.dll - OUTPUT_SUBDIRECTORY bearer -) - ly_add_target_files(TARGETS 3rdParty::Qt::Gui::Plugins FILES ${QT_PATH}/plugins/iconengines/qsvgicon$<$:d>.dll OUTPUT_SUBDIRECTORY iconengines @@ -38,7 +33,7 @@ ly_add_target_files(TARGETS 3rdParty::Qt::Gui::Plugins ) ly_add_target_files(TARGETS 3rdParty::Qt::Widgets::Plugins - FILES ${QT_PATH}/plugins/styles/qwindowsvistastyle$<$:d>.dll + FILES ${QT_PATH}/plugins/styles/qmodernwindowsstyle$<$:d>.dll OUTPUT_SUBDIRECTORY styles ) diff --git a/package-system/Qt/build-darwin-arm64.sh b/package-system/Qt/build-darwin-arm64.sh new file mode 100755 index 00000000..b0cc1a25 --- /dev/null +++ b/package-system/Qt/build-darwin-arm64.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# + +set -euo pipefail + +# Limit Ninja jobs lower to avoid out of memory issues build qtwebengine +export NINJAJOBS=-j12 +MAKE_FLAGS=-j32 + +# TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script +BUILD_PATH=$TEMP_FOLDER/build + +QTARRAY="qtbase,qtimageformats,qtsvg,qttranslations,qttools" +[[ -d $BUILD_PATH ]] || mkdir $BUILD_PATH +cd $BUILD_PATH + +_OPTS="-prefix ${TARGET_INSTALL_ROOT} \ + -submodules ${QTARRAY} \ + -platform macx-clang \ + -release \ + -c++std c++20 \ + -opensource \ + -qt-tiff \ + -qt-zlib \ + -confirm-license " + +echo Configuring Qt... +../src/configure ${_OPTS} + +cmake --build . --parallel +if [ $? -ne 0 ] +then + echo "Failed to install QT." + exit 1 +fi + +cmake --install . --config Release +if [ $? -ne 0 ] +then + echo "Failed to install QT Release." + exit 1 +fi + +echo Qt installed successfully! diff --git a/package-system/Qt/build-linux.sh b/package-system/Qt/build-linux.sh index e78034fd..0cd31ef2 100755 --- a/package-system/Qt/build-linux.sh +++ b/package-system/Qt/build-linux.sh @@ -24,174 +24,75 @@ CURRENT_HOST_ARCH=$(uname -m) # Use the host architecture if not supplied TARGET_ARCH=${4:-$(uname -m)} -# -# Make sure docker is installed -# -DOCKER_VERSION=$(docker --version) -if [ $? -ne 0 ] -then - echo "Required package docker is not installed" - echo "Follow instructions on https://docs.docker.com/engine/install/ubuntu/ to install docker properly" - exit 1 -fi -echo "Detected Docker Version $DOCKER_VERSION" - -# -# Check the target architecture and determine if the necessary cross compilation requirements are met -# - -# If the host and target architecture does not match, make sure the necessary cross compilation packages are installed +# If the host and target architecture does not match, we stop if [ "${CURRENT_HOST_ARCH}" != ${TARGET_ARCH} ] then - echo "Checking cross compiling requirements." - for package_check in docker-ce binfmt-support qemu-user-static - do - echo "Checking package $package_check" - dpkg -s $package_check > /dev/null 2>&1 - if [ $? -ne 0 ] - then - echo "" - echo "Missing package $package_check. Make sure to install it with your local package manager." - echo "" - exit 1 - fi - done - - # Only cross compilation of an ARM64 image on an x86_64 host is supported - if [ "${TARGET_ARCH}" = "aarch64" ] - then - # Make sure qemu-aarch64 is installed properly - QEMU_AARCH_COUNT=$(update-binfmts --display | grep qemu-aarch64 | wc -l) - if [ $QEMU_AARCH_COUNT -eq 0 ] - then - echo "" - echo "QEMU aarch64 binary format not registered." - echo "Run the following command to register" - echo "" - echo "sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes" - echo "" - exit 1 - fi - echo "" - echo "Cross compiling aarch64 on an amd64 machine validated." - echo "" - fi -else - echo "Building ${TARGET_ARCH} natively." -fi - -# Setup the docker arguments -if [ "${TARGET_ARCH}" = "x86_64" ] -then - echo "Processing Docker for amd64" - - DOCKER_INPUT_ARCHITECTURE=amd64 - TARGET_DOCKER_PLATFORM_ARG=linux/amd64 - -elif [ "${TARGET_ARCH}" = "aarch64" ] -then - echo "Processing Docker for aarch64" - - DOCKER_INPUT_ARCHITECTURE=arm64v8 - TARGET_DOCKER_PLATFORM_ARG=linux/arm64/v8 - -else - echo "Unsupported architecture ${TARGET_ARCH}" - exit 1 + echo "Cross compilation not supported" + exit 1 fi -# - -# Prepare the docker file and use the temp folder as the context root -cp docker_build_qt_linux.sh temp/ - -DOCKERFILE=Dockerfile -DOCKER_IMAGE_NAME_BASE=qt -DOCKER_BUILD_SCRIPT=docker_build_qt_linux.sh -DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME_BASE}_${DOCKER_INPUT_ARCHITECTURE}_3p -UBUNTU_BASE=20.04 - - -echo "Executing docker-based build from the following arguments" -echo " DOCKER_IMAGE_NAME_BASE=${DOCKER_IMAGE_NAME_BASE}" -echo " UBUNTU_BASE=${UBUNTU_BASE}" -echo " DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT}" -echo " TARGET_BUILD_FOLDER=${TARGET_BUILD_FOLDER}" -echo " TARGET_ARCH=${TARGET_ARCH}" -echo " DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME}" -echo "" - - -# Build the Docker Image -echo "Building the docker build script for ${DOCKER_IMAGE_NAME_BASE} on ${DOCKER_INPUT_ARCHITECTURE} for Ubuntu $1" -echo "" -CMD_DOCKER_BUILD="\ -docker build --build-arg INPUT_DOCKER_BUILD_SCRIPT=${DOCKER_BUILD_SCRIPT}\ - --build-arg INPUT_ARCHITECTURE=${DOCKER_INPUT_ARCHITECTURE}\ - --build-arg INPUT_IMAGE=ubuntu:${UBUNTU_BASE}\ - --platform ${TARGET_DOCKER_PLATFORM_ARG}\ - -f Dockerfile -t ${DOCKER_IMAGE_NAME}:latest temp" - echo ${CMD_DOCKER_BUILD} - eval ${CMD_DOCKER_BUILD} +# Qt6 dependencies. See https://doc.qt.io/qt-6/linux-requirements.html +sudo apt-get install -y libfontconfig1-dev \ + libfreetype-dev \ + libgtk-3-dev \ + libx11-dev \ + libx11-xcb-dev \ + libxcb-cursor-dev \ + libxcb-glx0-dev \ + libxcb-icccm4-dev \ + libxcb-image0-dev \ + libxcb-keysyms1-dev \ + libxcb-randr0-dev \ + libxcb-render-util0-dev \ + libxcb-shape0-dev \ + libxcb-shm0-dev \ + libxcb-sync-dev \ + libxcb-util-dev \ + libxcb-xfixes0-dev \ + libxcb-xkb-dev \ + libxcb1-dev \ + libxext-dev \ + libxfixes-dev \ + libxi-dev \ + libxkbcommon-dev \ + libxkbcommon-x11-dev \ + libxcb-xinerama0-dev \ + libxrender-dev + +QTARRAY="qtbase,qtimageformats,qtsvg,qttranslations,qtwayland" +BUILD_ROOT="${TEMP_FOLDER}/src" +BUILD_PATH="${TEMP_FOLDER}/build" + +echo ${BUILD_PATH} + +cd ${BUILD_PATH} + +_OPTS="-prefix ${TARGET_INSTALL_ROOT} \ + -submodules ${QTARRAY} \ + -platform linux-clang \ + -release \ + -c++std c++20 \ + -opensource \ + -xcb \ + -confirm-license " + +${BUILD_ROOT}/configure ${_OPTS} if [ $? -ne 0 ] then - echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." + echo "Failed to configure QT." exit 1 fi - -# Capture the Docker Image ID -IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest) -if [ -z $IMAGE_ID ] -then - echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}" - exit 1 -fi - -# Run the Docker Image -echo "Running docker build script" -docker run -v $TEMP_FOLDER/src:/data/workspace/src -v $TEMP_FOLDER/$TIFF_FOLDER_NAME:/data/workspace/o3de_tiff -v $TEMP_FOLDER/$ZLIB_FOLDER_NAME:/data/workspace/o3de_zlib -v $TEMP_FOLDER/$OPENSSL_FOLDER_NAME:/data/workspace/o3de_openssl --tty ${DOCKER_IMAGE_NAME}:latest ./docker_build_qt_linux.sh +cmake --build . --parallel if [ $? -ne 0 ] then - echo "Error occurred running Docker image ${DOCKER_IMAGE_NAME}:latest." - exit 1 -fi - - -# Capture the container ID -echo "Capturing the Container ID" -CONTAINER_ID=$(docker container ls -l -q --filter "ancestor=${DOCKER_IMAGE_NAME}:latest") -if [ -z $CONTAINER_ID ] -then - echo "Error: Cannot find Container ID for Image ${DOCKER_IMAGE_NAME}" + echo "Failed to install QT." exit 1 fi - -# Copy the build artifacts from the Docker Container -echo "Copying the built contents from the docker container for image ${DOCKER_IMAGE_NAME}" -docker cp --follow-link $CONTAINER_ID:/data/workspace/qt/. $TARGET_INSTALL_ROOT +cmake --install . --config Release if [ $? -ne 0 ] then - echo "Error occurred copying build artifacts from Docker image ${DOCKER_IMAGE_NAME}:latest." + echo "Failed to install QT Release." exit 1 fi - -# Clean up the docker image and container -echo "Cleaning up container" -docker container rm $CONTAINER_ID -if [ $? -ne 0 ] -then - echo "Warning: Unable to clean up container for image ${DOCKER_IMAGE_NAME}" -fi - -echo "Cleaning up image" -docker rmi --force $IMAGE_ID -if [ $? -ne 0 ] -then - echo "Warning: Unable to clean up image ${DOCKER_IMAGE_NAME}" -fi - -popd - -exit 0 diff --git a/package-system/Qt/build-windows.bat b/package-system/Qt/build-windows.bat index cf4a0199..478a728c 100644 --- a/package-system/Qt/build-windows.bat +++ b/package-system/Qt/build-windows.bat @@ -9,8 +9,8 @@ REM SPDX-License-Identifier: Apache-2.0 OR MIT REM REM Set these before running the script -if not defined VCVARS_PATH set VCVARS_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" -if not defined QTARRAY set QTARRAY=(qtbase,qtgraphicaleffects,qtimageformats,qtsvg,qttools,qtwinextras) +if not defined VCVARS_PATH set VCVARS_PATH="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" +if not defined QTARRAY set QTARRAY=qtbase,qtimageformats,qtsvg,qttranslations REM TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script set CHECKS_FAILED=0 @@ -23,69 +23,42 @@ for %%P IN (VCVARS_PATH,TEMP_FOLDER,TARGET_INSTALL_ROOT) do ( if %CHECKS_FAILED%==1 goto FAILURE -echo Setting up VS2019 +echo Setting up VS2022 call %VCVARS_PATH% amd64 -REM We need jom and ICU to build on Windows -set JOM_PATH=%TEMP_FOLDER%\jom -set ICU_PATH=%TEMP_FOLDER%\icu\bin64 - -set PATH=%PATH%;%JOM_PATH%;%ICU_PATH% - -REM The Qt source directory will get cloned into a local temp\src folder -set BUILD_ROOT=%TEMP_FOLDER%\src -set BUILD_PATH=%BUILD_ROOT%\qtbase - REM For OpenSSL support -set OPENSSL_ROOT=%TEMP_FOLDER%\OpenSSL-1.1.1m-rev1-windows\OpenSSL +set OPENSSL_ROOT=%TEMP_FOLDER%\OpenSSL-1.1.1o-rev1-windows\OpenSSL set OPENSSL_INCLUDE=%OPENSSL_ROOT%\include set OPENSSL_LIB_DEBUG=%OPENSSL_ROOT%\debug\lib set OPENSSL_LIB_RELEASE=%OPENSSL_ROOT%\lib set INCLUDE=%OPENSSL_INCLUDE%;%INCLUDE% set LIB=%OPENSSL_LIB_DEBUG%;%OPENSSL_LIB_RELEASE%;%LIB% -REM Base the Tiff of the dependent tiff O3DE package (static) -set TIFF_PREFIX=%TEMP_FOLDER%\tiff-4.2.0.15-rev3-windows\tiff -set TIFF_INCDIR=%TIFF_PREFIX%\include -set TIFF_LIBDIR=%TIFF_PREFIX%\lib - -REM We need to also bring in the zlib dependency since Tiff is a static lib dependency -set ZLIB_PREFIX=%TEMP_FOLDER%\zlib-1.2.11-rev5-windows\zlib -set ZLIB_INCDIR=%ZLIB_PREFIX%\include -set ZLIB_LIBDIR=%ZLIB_PREFIX%\lib +REM To prevent max path issues, we go as close as possible to disk root +cd %TEMP_FOLDER%\..\..\..\..\.. +rmdir b /S /Q +mkdir b +cd b -cd %BUILD_PATH% - -set _OPTS=-v^ - -prefix %TARGET_INSTALL_ROOT% ^ +set _OPTS=-prefix %TARGET_INSTALL_ROOT% ^ + -submodules %QTARRAY% ^ + -platform win32-msvc ^ -debug-and-release ^ + -c++std c++20 ^ -force-debug-info ^ + -separate-debug-info ^ -opensource ^ -confirm-license ^ - -nomake examples ^ - -nomake tests ^ - -shared ^ - --tiff=system ^ -opengl dynamic ^ -openssl-linked ^ - -I %TIFF_INCDIR% ^ - -I %ZLIB_INCDIR% ^ - -L %TIFF_LIBDIR% ^ - -L %ZLIB_LIBDIR% + -- -Wno-dev -cmd /c ""%BUILD_ROOT%\configure.bat" %_OPTS%" || goto FAILURE +cmd /c ""..\3p-package-source\source\package-system\Qt\temp\src\configure.bat" %_OPTS%" || goto FAILURE -for %%M IN %QTARRAY% do ( - echo Building %%M... - jom module-%%M || goto FAILURE - echo Built %%M. -) +cmd /c cmake --build . --parallel || goto FAILURE -for %%M IN %QTARRAY% do ( - echo Installing %%M... - jom module-%%M-install_subtargets || goto FAILURE - echo %%M installed. -) +cmd /c cmake --install . --config Debug || goto FAILURE +cmd /c cmake --install . --config RelWithDebInfo || goto FAILURE :FINISH exit diff --git a/package-system/Qt/build_config.json b/package-system/Qt/build_config.json index 9b9ab4b7..956826af 100644 --- a/package-system/Qt/build_config.json +++ b/package-system/Qt/build_config.json @@ -1,32 +1,27 @@ { - "git_url": "https://github.com/o3de/qt5.git", - "git_tag": "5.15.1-o3de", - "git_commit": "b3a1a6947422928e8aecb14ad607199e9720d266", + "git_url": "https://github.com/qt/qt5.git", + "git_tag": "6.10.2", + "git_commit": "abfb3788bcfd08d6192899eb39a8ff34d7546da8", "package_name": "qt", "package_url": "https://www.qt.io/", "package_license": "LGPL-3.0", - "package_license_file": "qt/LICENSE.LGPLv3", + "package_license_file": "LICENSES/LGPL-3.0-only.txt", "cmake_find_source": "FindQt.cmake", "cmake_find_target": "FindQt.cmake", "Platforms": { "Windows": { "Windows": { - "package_version": "5.15.2-rev7", - "patch_file": "qt-image-format-windows.patch", + "package_version": "6.10.2-rev1", "depends_on_packages": [ - ["OpenSSL-1.1.1m-rev1-windows", "7d8d3904c70b7da471f777ee788678614a9b20d3ac926b7c0d60ccf2a17c7959", ""], + ["OpenSSL-1.1.1o-rev1-windows", "52b9d2bc5f3e0c6e405a0f290d1904bf545acc0c73d6a52351247d917c4a06d2", ""], ["tiff-4.2.0.15-rev3-windows", "c6000a906e6d2a0816b652e93dfbeab41c9ed73cdd5a613acd53e553d0510b60", ""], ["zlib-1.2.11-rev5-windows", "8847112429744eb11d92c44026fc5fc53caa4a06709382b5f13978f3c26c4cbd", ""] ], - "additional_download_packages":[ - ["http://download.qt.io/official_releases/jom/jom.zip", "128fdd846fe24f8594eed37d1d8929a0ea78df563537c0c1b1861a635013fff8", "sha256"], - ["https://github.com/unicode-org/icu/releases/download/release-65-1/icu4c-65_1-Win64-MSVC2017.zip", "cfaf7477d65272e9e01c739951f0607642c0510235e46befc109f6a3addd4f43", "sha256"] - ], "custom_build_cmd": [ "build-windows.bat" ], "custom_install_cmd": [ - "{python}", "copy_platform_cmakes.py" + "python3", "copy_platform_cmakes.py" ] } }, @@ -45,12 +40,21 @@ "custom_install_cmd": [ "{python}", "copy_platform_cmakes.py" ] + }, + "Mac-arm64": { + "cmake_find_source": "FindQt.cmake", + "package_version": "6.10.2-rev1", + "custom_build_cmd": [ + "./build-darwin-arm64.sh" + ], + "custom_install_cmd": [ + "{python}", "copy_platform_cmakes.py" + ] } }, "Linux": { "Linux": { - "package_version": "5.15.2-rev10", - "patch_file": "qt-linux.patch", + "package_version": "6.10.2-rev2", "depends_on_packages": [ ["OpenSSL-1.1.1t-rev1-linux", "63aea898b7afe8faccd0c7261e62d2f8b7b870f678a4520d5be81e5815542b39", ""], ["tiff-4.2.0.15-rev3-linux", "2377f48b2ebc2d1628d9f65186c881544c92891312abe478a20d10b85877409a", ""], @@ -64,7 +68,7 @@ "x86_64" ], "custom_install_cmd": [ - "{python}", "copy_platform_cmakes.py" + "python3", "copy_platform_cmakes.py" ] }, "Linux-aarch64": { diff --git a/package-system/Qt/build_config_wayland.json b/package-system/Qt/build_config_wayland.json deleted file mode 100644 index 15caad56..00000000 --- a/package-system/Qt/build_config_wayland.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "git_url": "https://github.com/o3de/qt5.git", - "git_tag": "5.15.1-o3de", - "git_commit": "b3a1a6947422928e8aecb14ad607199e9720d266", - "package_name": "qt-wayland", - "package_url": "https://www.qt.io/", - "package_license": "LGPL-3.0", - "package_license_file": "qt/LICENSE.LGPLv3", - "cmake_find_source": "FindQt.cmake.wayland", - "cmake_find_target": "FindQt.cmake", - "Platforms": { - "Linux": { - "Linux": { - "package_version": "5.15.2-rev9", - "patch_file": "qt-linux.patch", - "depends_on_packages": [ - ["OpenSSL-1.1.1t-rev1-linux", "63aea898b7afe8faccd0c7261e62d2f8b7b870f678a4520d5be81e5815542b39", ""], - ["tiff-4.2.0.15-rev3-linux", "2377f48b2ebc2d1628d9f65186c881544c92891312abe478a20d10b85877409a", ""], - ["zlib-1.2.11-rev5-linux", "9be5ea85722fc27a8645a9c8a812669d107c68e6baa2ca0740872eaeb6a8b0fc", ""] - ], - "custom_build_cmd": [ - "./build-linux.sh", - "tiff-4.2.0.15-rev3-linux", - "zlib-1.2.11-rev5-linux", - "OpenSSL-1.1.1t-rev1-linux", - "wayland" - ], - "custom_install_cmd": [ - "{python}", "copy_platform_cmakes.py" - ] - }, - "Linux-aarch64": { - "package_version": "5.15.2-rev9", - "patch_file": "qt-linux.patch", - "depends_on_packages": [ - ["OpenSSL-1.1.1t-rev1-linux-aarch64", "f32721bec9c82d1bd7fb244d78d5dc4e2a47e7b808bb36027236ad377e241ea5", ""], - ["tiff-4.2.0.15-rev3-linux-aarch64", "429461014b21a530dcad597c2d91072ae39d937a04b7bbbf5c34491c41767f7f", ""], - ["zlib-1.2.11-rev5-linux-aarch64", "ce9d1ed2883d77ffc69c7982c078595c1f89ca55ec19d89fe7e6beb05f774775", ""] - ], - "custom_build_cmd": [ - "./build-linux.sh", - "tiff-4.2.0.15-rev3-linux-aarch64", - "zlib-1.2.11-rev5-linux-aarch64", - "OpenSSL-1.1.1t-rev1-linux-aarch64", - "wayland" - ], - "custom_install_cmd": [ - "{python}", "copy_platform_cmakes.py" - ] - } - } - } -} diff --git a/package-system/Qt/copy_platform_cmakes.py b/package-system/Qt/copy_platform_cmakes.py index 309d0313..87c18f31 100644 --- a/package-system/Qt/copy_platform_cmakes.py +++ b/package-system/Qt/copy_platform_cmakes.py @@ -13,6 +13,7 @@ import shutil import sys +print("Running copy_platform_cmakes.py") # There are some additional cmake files we need to copy per-platform to the install directory platform_system = platform.system().lower() @@ -41,8 +42,7 @@ # Install additional copyright notices to the package/qt root package_qt_root = os.path.join(package_root, "qt") additional_copyright_notices = ["QT-NOTICE.TXT", - "LICENSE", - os.path.join("temp","src", "qtfeedback", "LGPL_EXCEPTION.txt")] + "LICENSE"] for file in additional_copyright_notices: if not os.path.isfile(file): print(f"Error: Cannot locate copyright notice file: {file}") diff --git a/package-system/Qt/docker/build-linux-docker.bat b/package-system/Qt/docker/build-linux-docker.bat deleted file mode 100644 index 5dfd0312..00000000 --- a/package-system/Qt/docker/build-linux-docker.bat +++ /dev/null @@ -1 +0,0 @@ -docker build -f %~dp0\linux-build.Dockerfile -t lyeditor/qt-linux-build:5.15 %~dp0 diff --git a/package-system/Qt/docker/linux-build.Dockerfile b/package-system/Qt/docker/linux-build.Dockerfile deleted file mode 100644 index 5a0b69e5..00000000 --- a/package-system/Qt/docker/linux-build.Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM ubuntu:bionic - -RUN apt-get update - -# Qt5 build dependencies -RUN apt-get -y install git python make g++ clang gperf bison flex libnss3-dev libxrandr-dev libdbus-1-dev libxi-dev libxtst-dev libxcomposite-dev libxcursor-dev libc++-dev libc++abi-dev libssl-dev libfontconfig1-dev libxcb1-dev libglu1-mesa-dev mesa-common-dev libxkbcommon-x11-dev libxkbcommon-dev libx11-xcb-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xinput-dev libwebp-dev libopus-dev --fix-missing - -# Developer Tools -RUN apt-get -y install vim - -# O3DE build dependencies -RUN apt-get -y install build-essential -RUN apt-get -y install libgl-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev libsdl2-2.0-0 libsdl2-dev -RUN apt-get -y install clang-12 libc++-dev libc++abi-dev uuid-dev libz-dev libncurses5-dev libcurl4-openssl-dev libjpeg-dev libjbig-dev libpython3.7 - -RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 -RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100 - -RUN apt-get -y install wget -RUN apt-get update - -VOLUME /data diff --git a/package-system/Qt/docker_build_qt_linux.sh b/package-system/Qt/docker_build_qt_linux.sh deleted file mode 100755 index 7ce65755..00000000 --- a/package-system/Qt/docker_build_qt_linux.sh +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/bash - -# -# Copyright (c) Contributors to the Open 3D Engine Project. -# For complete copyright and license terms please see the LICENSE at the root of this distribution. -# -# SPDX-License-Identifier: Apache-2.0 OR MIT -# - -# TEMP_FOLDER and TARGET_INSTALL_ROOT get set from the pull_and_build_from_git.py script - -# Read the dependent 3P library paths from the arguments -TIFF_PACKAGE_DIR=/data/workspace/o3de_tiff -ZLIB_PACKAGE_DIR=/data/workspace/o3de_zlib -OPENSSL_PACKAGE_DIR=/data/workspace/o3de_openssl - -set -euo pipefail - -MAKE_FLAGS=-j32 - -echo "Building Qt5 from source with dependencies on" -echo " " $TIFF_PACKAGE_DIR -echo " " $ZLIB_PACKAGE_DIR -echo " " $OPENSSL_PACKAGE_DIR - -# Base the Tiff of the dependent tiff O3DE package (static) -TIFF_PREFIX=$TIFF_PACKAGE_DIR/tiff -TIFF_INCDIR=$TIFF_PREFIX/include -TIFF_LIBDIR=$TIFF_PREFIX/lib - -# Bring in the zlib dependency since Tiff is a static lib dependency -ZLIB_PREFIX=$ZLIB_PACKAGE_DIR/zlib -ZLIB_INCDIR=$ZLIB_PREFIX/include -ZLIB_LIBDIR=$ZLIB_PREFIX/lib - -# Bring in the openssl dependency based -OPENSSL_PREFIX=$OPENSSL_PACKAGE_DIR/OpenSSL -OPENSSL_INCDIR=$OPENSSL_PREFIX/include -OPENSSL_LIBDIR=$OPENSSL_PREFIX/lib - -BUILD_PATH=/data/workspace/build -INSTALL_PATH=/data/workspace/qt - -[[ -d $BUILD_PATH ]] || mkdir $BUILD_PATH -cd $BUILD_PATH - -echo Configuring Qt ... - -../src/configure -prefix ${INSTALL_PATH} \ - -opensource \ - -nomake examples \ - -nomake tests \ - -confirm-license \ - -no-icu \ - -dbus \ - -no-separate-debug-info \ - -release \ - -force-debug-info \ - -qt-libpng \ - -qt-libjpeg \ - -no-feature-vnc \ - -no-feature-linuxfb \ - --tiff=system \ - -qt-zlib \ - -v \ - -no-cups \ - -no-glib \ - -no-feature-renameat2 \ - -no-feature-getentropy \ - -no-feature-statx \ - -no-feature-wayland-server \ - -qpa xcb \ - -qpa wayland \ - -xcb-xlib \ - -openssl \ - -I $TIFF_INCDIR \ - -I $ZLIB_INCDIR \ - -I $OPENSSL_INCDIR \ - -L $TIFF_LIBDIR \ - -L $ZLIB_LIBDIR \ - -L $OPENSSL_LIBDIR \ - -c++std c++1z \ - -fontconfig - -if [ $? -ne 0 ] -then - echo "Failed to configure Qt" - exit 1 -fi - - -echo Qt configured, building modules... -qtarray=(qtbase qtgraphicaleffects qtimageformats qtsvg qttools qtx11extras) - -for qtlib in "${qtarray[@]}"; do - echo Building $qtlib... - make module-$qtlib $MAKE_FLAGS - - if [ $? -ne 0 ] - then - echo "Failed building Qt module $qtlib" - exit 1 - fi - - echo Built $qtlib. -done - -echo Finished building modules, installing... -for qtlib in "${qtarray[@]}"; do - echo Installing $qtlib... - make module-$qtlib-install_subtargets - - if [ $? -ne 0 ] - then - echo "Failed installing Qt module $qtlib" - exit 1 - fi - - echo $qtlib installed. -done - -cd /data/workspace/qtwayland - -/data/workspace/build/qtbase/bin/qmake -if [ $? -ne 0 ] -then - echo "qmake failed for qtwayland" - exit 1 -fi -make -if [ $? -ne 0 ] -then - echo "make failed for qtwayland" - exit 1 -fi - -make install -if [ $? -ne 0 ] -then - echo "make install failed for qtwayland" - exit 1 -fi - -rm ${INSTALL_PATH}/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/qwayland-server-qt-texture-sharing-unstable-v1.h -cp /data/workspace/qtwayland/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/qwayland-server-qt-texture-sharing-unstable-v1.h ${INSTALL_PATH}/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/ -rm ${INSTALL_PATH}/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/wayland-qt-texture-sharing-unstable-v1-server-protocol.h -cp /data/workspace/qtwayland/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/wayland-qt-texture-sharing-unstable-v1-server-protocol.h ${INSTALL_PATH}/include/QtWaylandCompositor/5.15.1/QtWaylandCompositor/private/ - - -echo Qt installed successfully! diff --git a/package-system/Qt/qt-image-format-windows.patch b/package-system/Qt/qt-image-format-windows.patch deleted file mode 100644 index 3bfa63b2..00000000 --- a/package-system/Qt/qt-image-format-windows.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/qtimageformats/src/imageformats/configure.json b/qtimageformats/src/imageformats/configure.json -index 5b876c3..f2fa1cc 100644 ---- a/qtimageformats/src/imageformats/configure.json -+++ b/qtimageformats/src/imageformats/configure.json -@@ -85,7 +85,7 @@ - }, - "sources": [ - { "type": "pkgConfig", "args": "libtiff-4" }, -- { "libs": "-ltiff" } -+ { "libs": "-ltiff -lzlibstatic" } - ] - }, - "webp": { diff --git a/package-system/Qt/qt-linux.patch b/package-system/Qt/qt-linux.patch deleted file mode 100644 index 0e610138..00000000 --- a/package-system/Qt/qt-linux.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/qtbase/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/qtbase/src/platformsupport/services/genericunix/qgenericunixservices.cpp -index b583d636c0..4615ebb126 100644 ---- a/qtbase/src/platformsupport/services/genericunix/qgenericunixservices.cpp -+++ b/qtbase/src/platformsupport/services/genericunix/qgenericunixservices.cpp -@@ -203,8 +203,7 @@ static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url) - // handle_token (s) - A string that will be used as the last element of the @handle. - // writable (b) - Whether to allow the chosen application to write to the file. - --#ifdef O_PATH -- const int fd = qt_safe_open(QFile::encodeName(url.toLocalFile()), O_PATH); -+ const int fd = qt_safe_open(QFile::encodeName(url.toLocalFile()), O_RDONLY); - if (fd != -1) { - QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.portal.Desktop"), - QLatin1String("/org/freedesktop/portal/desktop"), -@@ -219,9 +218,6 @@ static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url) - - return QDBusConnection::sessionBus().call(message); - } --#else -- Q_UNUSED(url) --#endif - - return QDBusMessage::createError(QDBusError::InternalError, qt_error_string()); - } - -diff --git a/qtimageformats/src/imageformats/configure.json b/qtimageformats/src/imageformats/configure.json -index 5b876c3..f2fa1cc 100644 ---- a/qtimageformats/src/imageformats/configure.json -+++ b/qtimageformats/src/imageformats/configure.json -@@ -85,7 +85,7 @@ - }, - "sources": [ - { "type": "pkgConfig", "args": "libtiff-4" }, -- { "libs": "-ltiff" } -+ { "libs": "-ltiff -lz" } - ] - }, - "webp": { diff --git a/package_build_list_host_darwin-arm64.json b/package_build_list_host_darwin-arm64.json index b597df68..9017c36c 100644 --- a/package_build_list_host_darwin-arm64.json +++ b/package_build_list_host_darwin-arm64.json @@ -24,6 +24,7 @@ "PhysX-4.1.2.29882248-rev8-mac-arm64": "package-system/PhysX/build_package_image.py --package-name PhysX-4.1.2.29882248 --package-rev rev8 --platform mac-arm64", "png-1.6.53-rev2-mac-arm64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/libpng --platform-name Mac-arm64 --clean", "python-3.10.13-rev1-mac-arm64": "package-system/python/build_package_image.py", + "qt-6.10.2-rev1-mac-arm64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Mac-arm64 --clean", "SPIRVCross-1.3.275.0-rev2-mac-arm64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/SPIRVCross --platform-name Mac-arm64 --clean", "squish-ccr-deb557d-rev1-mac-arm64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/squish-ccr --platform-name Mac-arm64 --clean", "SQLite-3.37.2-rev2-mac-arm64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/sqlite --platform-name Mac-arm64 --clean", @@ -51,6 +52,7 @@ "PhysX-4.1.2.29882248-rev8-mac-arm64": "package-system/PhysX-mac-arm64", "png-1.6.53-rev2-mac-arm64": "package-system/libpng/temp/png-mac-arm64", "python-3.10.13-rev1-mac-arm64": "package-system/python/darwin_arm64/package", + "qt-6.10.2-rev1-mac-arm64": "package-system/Qt/temp/qt-mac-arm64", "SPIRVCross-1.3.275.0-rev2-mac-arm64": "package-system/SPIRVCross/temp/SPIRVCross-mac-arm64", "squish-ccr-deb557d-rev1-mac-arm64": "package-system/squish-ccr/temp/squish-ccr-mac-arm64", "SQLite-3.37.2-rev2-mac-arm64": "package-system/sqlite/temp/SQLite-mac-arm64", diff --git a/package_build_list_host_linux.json b/package_build_list_host_linux.json index 569aa034..9a7dc66c 100644 --- a/package_build_list_host_linux.json +++ b/package_build_list_host_linux.json @@ -45,7 +45,7 @@ "python-3.10.13-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux --clean", "python-3.10.13-rev2-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/python --platform-name Linux-aarch64 --clean", "mikkelsen-1.0.0.4-linux": "package-system/mikkelsen/build_package_image.py", - "qt-5.15.2-rev10-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux --package-root ../../package-system/Qt/temp --clean", + "qt-6.10.2-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux --package-root ../../package-system/Qt/temp --clean", "qt-5.15.2-rev10-linux-aarch64": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux-aarch64 --package-root ../../package-system/Qt/temp", "zlib-1.2.11-rev5-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Linux --package-root ../../package-system --clean", "lz4-1.9.4-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/lz4 --platform-name Linux --package-root ../../package-system/lz4/temp --clean", @@ -96,7 +96,7 @@ "unwind-1.2.1-linux": "package-system/unwind-linux", "SQLite-3.37.2-rev1-linux": "package-system/SQLite-linux", "xxhash-0.7.4-rev1-multiplatform": "package-system/xxhash-multiplatform", - "qt-5.15.2-rev10-linux": "package-system/Qt/temp/qt-linux", + "qt-6.10.2-rev2-linux": "package-system/Qt/temp/qt-linux", "qt-5.15.2-rev10-linux-aarch64": "package-system/Qt/temp/qt-linux-aarch64", "zlib-1.2.11-rev5-linux": "package-system/zlib-linux", "lz4-1.9.4-rev2-linux": "package-system/lz4/temp/lz4-linux", diff --git a/package_build_list_host_windows.json b/package_build_list_host_windows.json index 2d383dc2..21d5e389 100644 --- a/package_build_list_host_windows.json +++ b/package_build_list_host_windows.json @@ -51,7 +51,7 @@ "pybind11-2.10.0-rev1-multiplatform": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pybind11 --platform-name multiplatform --package-root ../../package-system/pybind11/temp --clean", "pyside2-5.15.2.1-py3.10-rev3-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Windows --package-root ../../package-system/pyside2/temp --clean", "python-3.10.13-rev1-windows": "package-system/python/build_package_image.py", - "qt-5.15.2-rev7-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Windows --package-root ../../package-system/Qt/temp --clean", + "qt-6.10.2-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Windows --package-root ../../package-system/Qt/temp --clean", "RapidJSON-1.1.0-rev1-multiplatform": "Scripts/extras/pull_and_build_from_git.py ../../package-system/RapidJSON --platform-name multiplatform --package-root ../../package-system", "SPIRVCross-1.3.275.0-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/SPIRVCross --platform-name Windows --package-root ../../package-system --clean", "SQLite-3.37.2-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/sqlite --platform-name Windows --package-root ../../package-system --clean", @@ -120,7 +120,7 @@ "pybind11-2.10.0-rev1-multiplatform": "package-system/pybind11/temp/pybind11-multiplatform", "pyside2-5.15.2.1-py3.10-rev3-windows": "package-system/pyside2/temp/pyside2-windows", "python-3.10.13-rev1-windows": "package-system/python/win_x64/package", - "qt-5.15.2-rev7-windows": "package-system/Qt/temp/qt-windows", + "qt-6.10.2-rev1-windows": "package-system/Qt/temp/qt-windows", "RapidJSON-1.1.0-rev1-multiplatform": "package-system/RapidJSON-multiplatform", "RapidXML-1.13-rev1-multiplatform": "package-system/RapidXML-multiplatform", "SPIRVCross-1.3.275.0-rev1-windows": "package-system/SPIRVCross-windows",