early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,151 @@
function(configure_qt)
cmake_parse_arguments(_csc "" "SOURCE_PATH;TARGET_PLATFORM;HOST_PLATFORM;HOST_TOOLS_ROOT" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN})
if(NOT _csc_TARGET_PLATFORM)
message(FATAL_ERROR "configure_qt requires a TARGET_PLATFORM argument.")
endif()
if(DEFINED _csc_HOST_PLATFORM)
list(APPEND _csc_OPTIONS -platform ${_csc_HOST_PLATFORM})
endif()
if(DEFINED _csc_HOST_TOOLS_ROOT)
## vcpkg internal file struture assumed here!
message(STATUS "Building Qt with prepared host tools from ${_csc_HOST_TOOLS_ROOT}!")
vcpkg_add_to_path("${_csc_HOST_TOOLS_ROOT}/bin")
vcpkg_add_to_path("${_csc_HOST_TOOLS_ROOT}")
set(EXT_BIN_DIR -external-hostbindir ${_csc_HOST_TOOLS_ROOT}/bin) # we only use release binaries for building
find_program(QMAKE_COMMAND NAMES qmake PATHS ${_csc_HOST_TOOLS_ROOT}/bin NO_DEFAULT_PATH)
set(INVOKE "${QMAKE_COMMAND}" )
else()
if(CMAKE_HOST_WIN32)
set(CONFIGURE_BAT "configure.bat")
else()
set(CONFIGURE_BAT "configure")
endif()
set(INVOKE "${_csc_SOURCE_PATH}/${CONFIGURE_BAT}")
endif()
#Cleanup previous build folders
file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
#Find and ad Perl to PATH
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
vcpkg_add_to_path("${PERL_EXE_PATH}")
if("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
list(APPEND _csc_OPTIONS -static)
else()
#list(APPEND _csc_OPTIONS_DEBUG -separate-debug-info)
endif()
if(VCPKG_TARGET_IS_WINDOWS AND "${VCPKG_CRT_LINKAGE}" STREQUAL "static")
list(APPEND _csc_OPTIONS -static-runtime)
endif()
list(APPEND _csc_OPTIONS_RELEASE -release)
list(APPEND _csc_OPTIONS_DEBUG -debug)
#Replace with VCPKG variables if PR #7733 is merged
unset(BUILDTYPES)
if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug")
set(_buildname "DEBUG")
list(APPEND BUILDTYPES ${_buildname})
set(_short_name_${_buildname} "dbg")
set(_path_suffix_${_buildname} "/debug")
set(_build_type_${_buildname} "debug")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release")
set(_buildname "RELEASE")
list(APPEND BUILDTYPES ${_buildname})
set(_short_name_${_buildname} "rel")
set(_path_suffix_${_buildname} "")
set(_build_type_${_buildname} "release")
endif()
unset(_buildname)
vcpkg_find_acquire_program(PKGCONFIG)
set(ENV{PKG_CONFIG} "${PKGCONFIG}")
get_filename_component(PKGCONFIG_PATH "${PKGCONFIG}" DIRECTORY)
vcpkg_add_to_path("${PKGCONFIG_PATH}")
foreach(_buildname ${BUILDTYPES})
set(PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${_path_suffix_${_buildname}}/lib/pkgconfig")
set(PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig")
set(PKGCONFIG_PACKAGES_DIR "${_VCPKG_PACKAGES_PKGCONF}${_path_suffix_${_buildname}}/lib/pkgconfig")
set(PKGCONFIG_PACKAGES_SHARE_DIR "${_VCPKG_PACKAGES_PKGCONF}/share/pkgconfig")
if(DEFINED ENV{PKG_CONFIG_PATH})
set(BACKUP_ENV_PKG_CONFIG_PATH_${_config} $ENV{PKG_CONFIG_PATH})
set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}")
else()
set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}")
endif()
set(_build_triplet ${TARGET_TRIPLET}-${_short_name_${_buildname}})
message(STATUS "Configuring ${_build_triplet}")
set(_build_dir "${CURRENT_BUILDTREES_DIR}/${_build_triplet}")
file(MAKE_DIRECTORY ${_build_dir})
# These paths get hardcoded into qmake. So point them into the CURRENT_INSTALLED_DIR instead of CURRENT_PACKAGES_DIR
# makefiles will be fixed to install into CURRENT_PACKAGES_DIR in install_qt
set(BUILD_OPTIONS ${_csc_OPTIONS} ${_csc_OPTIONS_${_buildname}}
-prefix ${CURRENT_INSTALLED_DIR}
#-extprefix ${CURRENT_INSTALLED_DIR}
${EXT_BIN_DIR}
-hostprefix ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}
#-hostprefix ${CURRENT_INSTALLED_DIR}/tools/qt5
-hostlibdir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}/lib # could probably be move to manual-link
-hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}/bin
#-hostbindir ${CURRENT_INSTALLED_DIR}/tools/qt5/bin
# Qt VS Plugin requires a /bin subfolder with the executables in the root dir. But to use the wizard a correctly setup lib folder is also required
# So with the vcpkg layout there is no way to make it work unless all dll are are copied to tools/qt5/bin and all libs to tools/qt5/lib
-archdatadir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}
-datadir ${CURRENT_INSTALLED_DIR}${_path_suffix}/share/qt5${_path_suffix_${_buildname}}
-plugindir ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/plugins
-qmldir ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/qml
-headerdir ${CURRENT_INSTALLED_DIR}/include/qt5
-libexecdir ${CURRENT_INSTALLED_DIR}/tools/qt5${_path_suffix_${_buildname}}
-bindir ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/bin
-libdir ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/lib
-I ${CURRENT_INSTALLED_DIR}/include
-I ${CURRENT_INSTALLED_DIR}/include/qt5
-L ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/lib
-L ${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}/lib/manual-link
-platform ${_csc_TARGET_PLATFORM}
)
if(DEFINED _csc_HOST_TOOLS_ROOT) #use qmake
if(WIN32)
set(INVOKE_OPTIONS "QMAKE_CXX.QMAKE_MSC_VER=1911" "QMAKE_MSC_VER=1911")
endif()
vcpkg_execute_required_process(
COMMAND ${INVOKE} "${_csc_SOURCE_PATH}" "${INVOKE_OPTIONS}" -- ${BUILD_OPTIONS}
WORKING_DIRECTORY ${_build_dir}
LOGNAME config-${_build_triplet}
)
else()# call configure (builds qmake for triplet and calls it like above)
vcpkg_execute_required_process(
COMMAND "${INVOKE}" ${BUILD_OPTIONS}
WORKING_DIRECTORY ${_build_dir}
LOGNAME config-${_build_triplet}
)
endif()
# Note archdatadir and datadir are required to be prefixed with the hostprefix?
message(STATUS "Configuring ${_build_triplet} done")
# Copy configuration dependent qt.conf
file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" CMAKE_CURRENT_PACKAGES_DIR_PATH)
file(TO_CMAKE_PATH "${CURRENT_INSTALLED_DIR}" CMAKE_CURRENT_INSTALLED_DIR_PATH)
file(READ "${CURRENT_BUILDTREES_DIR}/${_build_triplet}/bin/qt.conf" _contents)
string(REPLACE "${CMAKE_CURRENT_PACKAGES_DIR_PATH}" "\${CURRENT_INSTALLED_DIR}" _contents ${_contents})
string(REPLACE "${CMAKE_CURRENT_INSTALLED_DIR_PATH}" "\${CURRENT_INSTALLED_DIR}" _contents ${_contents})
#string(REPLACE "HostPrefix=\${CURRENT_PACKAGES_DIR}" "HostPrefix=\${CURRENT_INSTALLED_DIR}" _contents ${_contents})
string(REPLACE "[EffectivePaths]\nPrefix=..\n" "" _contents ${_contents})
string(REGEX REPLACE "\\[EffectiveSourcePaths\\]\r?\nPrefix=[^\r\n]+\r?\n" "" _contents ${_contents})
string(REPLACE "Sysroot=\n" "" _contents ${_contents})
string(REPLACE "SysrootifyPrefix=false\n" "" _contents ${_contents})
file(WRITE "${CURRENT_PACKAGES_DIR}/tools/qt5/qt_${_build_type_${_buildname}}.conf" "${_contents}")
endforeach()
endfunction()

View File

@@ -0,0 +1,101 @@
function(find_qt_mkspec TARGET_PLATFORM_MKSPEC_OUT HOST_PLATFORM_MKSPEC_OUT EXT_HOST_TOOLS_OUT)
## Figure out QTs target mkspec
if(NOT DEFINED VCPKG_QT_TARGET_MKSPEC)
message(STATUS "Figuring out qt target mkspec. Target arch ${VCPKG_TARGET_ARCHITECTURE}")
if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_IS_UWP)
if(VCPKG_PLATFORM_TOOLSET STREQUAL "v140")
set(msvc_year "2015")
elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v141")
set(msvc_year "2017")
elseif(VCPKG_PLATFORM_TOOLSET STREQUAL "v142")
set(msvc_year "2019")
else()
message(FATAL_ERROR "No target mkspec found!")
endif()
set(_tmp_targ_out "winrt-${VCPKG_TARGET_ARCHITECTURE}-msvc${msvc_year}")
else()
if("${VCPKG_TARGET_ARCHITECTURE}" MATCHES "arm64")
message(STATUS "Figuring out arm64")
set(_tmp_targ_out "win32-arm64-msvc2017") #mkspec does not have anything defined related to msvc2017 so this should work
else()
set(_tmp_targ_out "win32-msvc")
endif()
endif()
elseif(VCPKG_TARGET_IS_LINUX)
set(_tmp_targ_out "linux-g++" )
elseif(VCPKG_TARGET_IS_OSX)
set(_tmp_targ_out "macx-clang") # switch to macx-g++ since vcpkg requires g++ to compile any way?
endif()
else()
set(_tmp_targ_out ${VCPKG_QT_TARGET_MKSPEC})
endif()
message(STATUS "Target mkspec set to: ${_tmp_targ_out}")
set(${TARGET_PLATFORM_MKSPEC_OUT} ${_tmp_targ_out} PARENT_SCOPE)
## Figure out QTs host mkspec
if(NOT DEFINED VCPKG_QT_HOST_MKSPEC)
#if(WIN32)
# set(_tmp_host_out "win32-msvc")
#elseif("${CMAKE_HOST_SYSTEM}" STREQUAL "Linux")
# set(_tmp_host_out "linux-g++")
#elseif("${CMAKE_HOST_SYSTEM}" STREQUAL "Darwin")
# set(_tmp_host_out "macx-clang")
#endif()
if(DEFINED _tmp_host_out)
message(STATUS "Host mkspec set to: ${_tmp_host_out}")
else()
message(STATUS "Host mkspec not set. Qt's own buildsystem will try to figure out the host system")
endif()
else()
set(_tmp_host_out ${VCPKG_QT_HOST_MKSPEC})
endif()
if(DEFINED _tmp_host_out)
set(${HOST_PLATFORM_MKSPEC_OUT} ${_tmp_host_out} PARENT_SCOPE)
endif()
## Figure out VCPKG qt-tools directory for the port.
if(NOT DEFINED VCPKG_QT_HOST_TOOLS_ROOT AND DEFINED VCPKG_QT_HOST_PLATFORM) ## Root dir of the required host tools
if(NOT "${_tmp_host_out}" MATCHES "${_tmp_host_out}")
if(CMAKE_HOST_WIN32)
if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[aA][rR][mM]64")
list(APPEND _test_triplets arm64-windows)
elseif($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[aA][mM][dD]64")
list(APPEND _test_triplets x64-windows x64-windows-static)
list(APPEND _test_triplets x86-windows x86-windows-static)
elseif($ENV{PROCESSOR_ARCHITECTURE} MATCHES "x86")
list(APPEND _test_triplets x86-windows x86-windows-static)
else()
message(FATAL_ERROR "Unknown host processor! Host Processor $ENV{PROCESSOR_ARCHITECTURE}")
endif()
elseif(CMAKE_HOST_SYSTEM STREQUAL "Linux")
list(APPEND _test_triplets "x64-linux")
elseif(CMAKE_HOST_SYSTEM STREQUAL "Darwin")
list(APPEND _test_triplets "x64-osx")
else()
endif()
foreach(_triplet ${_test_triplets})
find_program(QMAKE_PATH qmake PATHS ${VCPKG_INSTALLED_DIR}/${_triplet}/tools/qt5/bin NO_DEFAULT_PATHS)
message(STATUS "Checking: ${VCPKG_INSTALLED_DIR}/${_triplet}/tools/qt5/bin. ${QMAKE_PATH}")
if(QMAKE_PATH)
set(_tmp_host_root "${VCPKG_INSTALLED_DIR}/${_triplet}/tools/qt5")
set(_tmp_host_qmake ${QMAKE_PATH} PARENT_SCOPE)
message(STATUS "Qt host tools root dir within vcpkg: ${_tmp_host_root}")
break()
endif()
endforeach()
if(NOT DEFINED _tmp_host_root)
message(FATAL_ERROR "Unable to locate required host tools. Please define VCPKG_QT_HOST_TOOLS_ROOT to the required root dir of the host tools")
endif()
endif()
else()
set(_tmp_host_root ${VCPKG_QT_HOST_TOOLS_ROOT})
endif()
if(DEFINED _tmp_host_root)
set(${EXT_HOST_TOOLS_OUT} ${_tmp_host_root} PARENT_SCOPE)
endif()
endfunction()

View File

@@ -0,0 +1,129 @@
include(qt_fix_makefile_install)
function(install_qt)
if(CMAKE_HOST_WIN32)
if (VCPKG_QMAKE_USE_NMAKE)
find_program(NMAKE nmake REQUIRED)
set(INVOKE "${NMAKE}")
set(INVOKE_SINGLE "${NMAKE}")
get_filename_component(NMAKE_EXE_PATH ${NMAKE} DIRECTORY)
set(PATH_GLOBAL "$ENV{PATH}")
set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}")
set(ENV{CL} "$ENV{CL} /MP${VCPKG_CONCURRENCY}")
else()
vcpkg_find_acquire_program(JOM)
set(INVOKE "${JOM}" /J ${VCPKG_CONCURRENCY})
set(INVOKE_SINGLE "${JOM}" /J 1)
endif()
else()
find_program(MAKE make)
set(INVOKE "${MAKE}" -j${VCPKG_CONCURRENCY})
set(INVOKE_SINGLE "${MAKE}" -j1)
endif()
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY)
vcpkg_add_to_path(PREPEND "${PYTHON3_EXE_PATH}")
if (CMAKE_HOST_WIN32)
# flex and bison for ANGLE library
vcpkg_find_acquire_program(FLEX)
get_filename_component(FLEX_EXE_PATH ${FLEX} DIRECTORY)
get_filename_component(FLEX_DIR ${FLEX_EXE_PATH} NAME)
file(COPY ${FLEX_EXE_PATH} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-tools" )
set(FLEX_TEMP "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-tools/${FLEX_DIR}")
file(RENAME "${FLEX_TEMP}/win_bison.exe" "${FLEX_TEMP}/bison.exe")
file(RENAME "${FLEX_TEMP}/win_flex.exe" "${FLEX_TEMP}/flex.exe")
vcpkg_add_to_path("${FLEX_TEMP}")
endif()
set(_path "$ENV{PATH}")
#Replace with VCPKG variables if PR #7733 is merged
unset(BUILDTYPES)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(_buildname "DEBUG")
list(APPEND BUILDTYPES ${_buildname})
set(_short_name_${_buildname} "dbg")
set(_path_suffix_${_buildname} "/debug")
set(_build_type_${_buildname} "debug")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
set(_buildname "RELEASE")
list(APPEND BUILDTYPES ${_buildname})
set(_short_name_${_buildname} "rel")
set(_path_suffix_${_buildname} "")
set(_build_type_${_buildname} "release")
endif()
unset(_buildname)
foreach(_buildname ${BUILDTYPES})
set(_build_triplet ${TARGET_TRIPLET}-${_short_name_${_buildname}})
set(_installed_prefix_ "${CURRENT_INSTALLED_DIR}${_path_suffix_${_buildname}}")
set(_installed_libpath_ "${_installed_prefix_}/lib/${VCPKG_HOST_PATH_SEPARATOR}${_installed_prefix_}/lib/manual-link/")
vcpkg_add_to_path(PREPEND "${_installed_prefix_}/bin")
vcpkg_add_to_path(PREPEND "${_installed_prefix_}/lib")
# We set LD_LIBRARY_PATH ENV variable to allow executing Qt tools (rcc,...) even with dynamic linking
if(CMAKE_HOST_UNIX)
if(DEFINED ENV{LD_LIBRARY_PATH})
set(_ld_library_path_defined_ TRUE)
set(_ld_library_path_backup_ $ENV{LD_LIBRARY_PATH})
set(ENV{LD_LIBRARY_PATH} "${_installed_libpath_}${VCPKG_HOST_PATH_SEPARATOR}${_ld_library_path_backup_}")
else()
set(_ld_library_path_defined_ FALSE)
set(ENV{LD_LIBRARY_PATH} "${_installed_libpath_}")
endif()
endif()
if(VCPKG_TARGET_IS_OSX)
# For some reason there will be an error on MacOSX without this clean!
message(STATUS "Cleaning before build ${_build_triplet}")
vcpkg_execute_required_process(
COMMAND ${INVOKE_SINGLE} clean
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${_build_triplet}
LOGNAME cleaning-1-${_build_triplet}
)
endif()
message(STATUS "Building ${_build_triplet}")
vcpkg_execute_build_process(
COMMAND ${INVOKE}
NO_PARALLEL_COMMAND ${INVOKE_SINGLE}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${_build_triplet}
LOGNAME build-${_build_triplet}
)
if(VCPKG_TARGET_IS_OSX)
# For some reason there will be an error on MacOSX without this clean!
message(STATUS "Cleaning after build before install ${_build_triplet}")
vcpkg_execute_required_process(
COMMAND ${INVOKE_SINGLE} clean
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${_build_triplet}
LOGNAME cleaning-2-${_build_triplet}
)
endif()
message(STATUS "Fixing makefile installation path ${_build_triplet}")
qt_fix_makefile_install("${CURRENT_BUILDTREES_DIR}/${_build_triplet}")
message(STATUS "Installing ${_build_triplet}")
vcpkg_execute_required_process(
COMMAND ${INVOKE} install
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${_build_triplet}
LOGNAME package-${_build_triplet}
)
message(STATUS "Package ${_build_triplet} done")
set(ENV{PATH} "${_path}")
# Restore backup
if(CMAKE_HOST_UNIX)
if(_ld_library_path_defined_)
set(ENV{LD_LIBRARY_PATH} "${_ld_library_path_backup_}")
else()
unset(ENV{LD_LIBRARY_PATH})
endif()
endif()
endforeach()
endfunction()

View File

@@ -0,0 +1,129 @@
function(qt_build_submodule SOURCE_PATH)
# This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings
set(ENV{_CL_} "/utf-8")
if(NOT PORT STREQUAL "qt5-webengine")
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY)
vcpkg_add_to_path("${PYTHON3_EXE_PATH}")
endif()
vcpkg_configure_qmake(SOURCE_PATH ${SOURCE_PATH} ${ARGV})
vcpkg_build_qmake(SKIP_MAKEFILES)
#Fix the installation location within the makefiles
qt_fix_makefile_install("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/")
qt_fix_makefile_install("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/")
#Install the module files
vcpkg_build_qmake(TARGETS install SKIP_MAKEFILES BUILD_LOGNAME install)
qt_fix_cmake(${CURRENT_PACKAGES_DIR} ${PORT})
vcpkg_fixup_pkgconfig() # Needs further investigation if this is enough!
#Replace with VCPKG variables if PR #7733 is merged
unset(BUILDTYPES)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(_buildname "DEBUG")
list(APPEND BUILDTYPES ${_buildname})
set(_short_name_${_buildname} "dbg")
set(_path_suffix_${_buildname} "/debug")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
set(_buildname "RELEASE")
list(APPEND BUILDTYPES ${_buildname})
set(_short_name_${_buildname} "rel")
set(_path_suffix_${_buildname} "")
endif()
unset(_buildname)
foreach(_buildname ${BUILDTYPES})
set(CURRENT_BUILD_PACKAGE_DIR "${CURRENT_PACKAGES_DIR}${_path_suffix_${_buildname}}")
#Fix PRL files
file(GLOB_RECURSE PRL_FILES "${CURRENT_BUILD_PACKAGE_DIR}/lib/*.prl" "${CURRENT_PACKAGES_DIR}/tools/qt5${_path_suffix_${_buildname}}/lib/*.prl"
"${CURRENT_PACKAGES_DIR}/tools/qt5${_path_suffix_${_buildname}}/mkspecs/*.pri")
qt_fix_prl("${CURRENT_BUILD_PACKAGE_DIR}" "${PRL_FILES}")
# This makes it impossible to use the build tools in any meaningful way. qt5 assumes they are all in one folder!
# So does the Qt VS Plugin which even assumes all of the in a bin folder
#Move tools to the correct directory
#if(EXISTS ${CURRENT_BUILD_PACKAGE_DIR}/tools/qt5)
# file(RENAME ${CURRENT_BUILD_PACKAGE_DIR}/tools/qt5 ${CURRENT_PACKAGES_DIR}/tools/${PORT})
#endif()
# Move executables in bin to tools
# This is ok since those are not build tools.
file(GLOB PACKAGE_EXE ${CURRENT_BUILD_PACKAGE_DIR}/bin/*.exe)
if(PACKAGE_EXE)
file(INSTALL ${PACKAGE_EXE} DESTINATION "${CURRENT_BUILD_PACKAGE_DIR}/tools/${PORT}")
file(REMOVE ${PACKAGE_EXE})
foreach(_exe ${PACKAGE_EXE})
string(REPLACE ".exe" ".pdb" _prb_file ${_exe})
if(EXISTS ${_prb_file})
file(INSTALL ${_prb_file} DESTINATION "${CURRENT_BUILD_PACKAGE_DIR}/tools/${PORT}")
file(REMOVE ${_prb_file})
endif()
endforeach()
endif()
#cleanup empty folders
file(GLOB PACKAGE_LIBS "${CURRENT_BUILD_PACKAGE_DIR}/lib/*")
if(NOT PACKAGE_LIBS)
file(REMOVE_RECURSE "${CURRENT_BUILD_PACKAGE_DIR}/lib")
endif()
file(GLOB PACKAGE_BINS "${CURRENT_BUILD_PACKAGE_DIR}/bin/*")
if(NOT PACKAGE_BINS)
file(REMOVE_RECURSE "${CURRENT_BUILD_PACKAGE_DIR}/bin")
endif()
endforeach()
if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/qt5/bin")
file(COPY "${CURRENT_PACKAGES_DIR}/tools/qt5/bin" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
set(CURRENT_INSTALLED_DIR_BACKUP "${CURRENT_INSTALLED_DIR}")
set(CURRENT_INSTALLED_DIR "./../../.." ) # Making the qt.conf relative and not absolute
configure_file(${CURRENT_INSTALLED_DIR_BACKUP}/tools/qt5/qt_release.conf ${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/qt.conf) # This makes the tools at least useable for release
set(CURRENT_INSTALLED_DIR "${CURRENT_INSTALLED_DIR_BACKUP}")
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(GLOB_RECURSE DLL_DEPS_AVAIL "${CURRENT_INSTALLED_DIR}/tools/qt5/bin/*.dll")
string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/qt5/bin/" "" DLL_DEPS_AVAIL "${DLL_DEPS_AVAIL}")
file(GLOB_RECURSE DLL_DEPS_NEEDED "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/*.dll")
string(REPLACE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/" "" DLL_DEPS_NEEDED "${DLL_DEPS_NEEDED}")
if(DLL_DEPS_AVAIL AND DLL_DEPS_NEEDED)
list(REMOVE_ITEM DLL_DEPS_NEEDED ${DLL_DEPS_AVAIL})
endif()
foreach(dll_dep ${DLL_DEPS_NEEDED})
string(REGEX REPLACE "[^/]+$" "" dll_subpath "${dll_dep}")
file(COPY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/${dll_dep}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/qt5/bin/${dll_subpath}")
endforeach()
endif()
endif()
#This should be removed if somehow possible
if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/qt5/debug/bin")
set(CURRENT_INSTALLED_DIR_BACKUP "${CURRENT_INSTALLED_DIR}")
set(CURRENT_INSTALLED_DIR "./../../../.." ) # Making the qt.conf relative and not absolute
configure_file(${CURRENT_INSTALLED_DIR_BACKUP}/tools/qt5/qt_debug.conf ${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/qt.conf) # This makes the tools at least useable for release
set(CURRENT_INSTALLED_DIR "${CURRENT_INSTALLED_DIR_BACKUP}")
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin")
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(GLOB_RECURSE DLL_DEPS_AVAIL "${CURRENT_INSTALLED_DIR}/tools/qt5/debug/bin/*.dll")
string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/qt5/debug/bin/" "" DLL_DEPS_AVAIL "${DLL_DEPS_AVAIL}")
file(GLOB_RECURSE DLL_DEPS_NEEDED "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/*.dll")
string(REPLACE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/" "" DLL_DEPS_NEEDED "${DLL_DEPS_NEEDED}")
if(DLL_DEPS_AVAIL AND DLL_DEPS_NEEDED)
list(REMOVE_ITEM DLL_DEPS_NEEDED ${DLL_DEPS_AVAIL})
endif()
foreach(dll_dep ${DLL_DEPS_NEEDED})
string(REGEX REPLACE "[^/]+$" "" dll_subpath "${dll_dep}")
file(COPY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/${dll_dep}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/qt5/debug/bin/${dll_subpath}")
endforeach()
endif()
endif()
endfunction()

View File

@@ -0,0 +1,41 @@
function(qt_get_submodule_name OUT_NAME)
string(REPLACE "5-" "" _tmp_name ${PORT})
set(${OUT_NAME} ${_tmp_name} PARENT_SCOPE)
endfunction()
function(qt_download_submodule)
cmake_parse_arguments(_csc "" "OUT_SOURCE_PATH" "PATCHES;BUILD_OPTIONS;BUILD_OPTIONS_RELEASE;BUILD_OPTIONS_DEBUG" ${ARGN})
if(NOT DEFINED _csc_OUT_SOURCE_PATH)
message(FATAL_ERROR "qt_download_module requires parameter OUT_SOURCE_PATH to be set! Please correct the portfile!")
endif()
vcpkg_buildpath_length_warning(37)
qt_get_submodule_name(NAME)
set(FULL_VERSION "${QT_MAJOR_MINOR_VER}.${QT_PATCH_VER}")
set(ARCHIVE_NAME "${NAME}-everywhere-opensource-src-${FULL_VERSION}.tar.xz")
set(URLS "https://download.qt.io/official_releases/qt/${QT_MAJOR_MINOR_VER}/${FULL_VERSION}/submodules/${ARCHIVE_NAME}"
"https://mirrors.ocf.berkeley.edu/qt/official_releases/qt/${QT_MAJOR_MINOR_VER}/${FULL_VERSION}/submodules/${ARCHIVE_NAME}"
)
vcpkg_download_distfile(ARCHIVE_FILE
URLS ${URLS}
FILENAME ${ARCHIVE_NAME}
SHA512 ${QT_HASH_${PORT}}
)
if(QT_UPDATE_VERSION)
file(SHA512 "${ARCHIVE_FILE}" ARCHIVE_HASH)
message(STATUS "${PORT} new hash is ${ARCHIVE_HASH}")
file(APPEND "${VCPKG_ROOT_DIR}/ports/qt5-base/cmake/qt_new_hashes.cmake" "set(QT_HASH_${PORT} ${ARCHIVE_HASH})\n")
else()
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE "${ARCHIVE_FILE}"
REF ${FULL_VERSION}
PATCHES ${_csc_PATCHES}
)
endif()
set(${_csc_OUT_SOURCE_PATH} ${SOURCE_PATH} PARENT_SCOPE)
endfunction()

View File

@@ -0,0 +1,21 @@
function(qt_fix_cmake PACKAGE_DIR_TO_FIX PORT_TO_FIX)
file(GLOB_RECURSE cmakefiles ${PACKAGE_DIR_TO_FIX}/share/cmake/*.cmake ${PACKAGE_DIR_TO_FIX}/lib/cmake/*.cmake)
foreach(cmakefile ${cmakefiles})
file(READ "${cmakefile}" _contents)
if(_contents MATCHES "_install_prefix}/tools/qt5/bin/([a-z0-9]+)") # there are only about 3 to 5 cmake files which require the fix in ports: qt5-tools qt5-xmlpattern at5-activeqt qt5-quick
string(REGEX REPLACE "_install_prefix}/tools/qt5/bin/([a-z0-9]+)" "_install_prefix}/tools/${PORT_TO_FIX}/bin/\\1" _contents "${_contents}")
file(WRITE "${cmakefile}" "${_contents}")
endif()
endforeach()
#Install cmake files
if(EXISTS ${PACKAGE_DIR_TO_FIX}/lib/cmake)
file(MAKE_DIRECTORY ${PACKAGE_DIR_TO_FIX}/share)
file(RENAME ${PACKAGE_DIR_TO_FIX}/lib/cmake ${PACKAGE_DIR_TO_FIX}/share/cmake)
endif()
#Remove extra cmake files
if(EXISTS ${PACKAGE_DIR_TO_FIX}/debug/lib/cmake)
file(REMOVE_RECURSE ${PACKAGE_DIR_TO_FIX}/debug/lib/cmake)
endif()
endfunction()

View File

@@ -0,0 +1,30 @@
#Could probably be a vcpkg_fix_makefile_install for other ports?
function(qt_fix_makefile_install BUILD_DIR)
#Fix the installation location
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR)
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR)
if(WIN32)
string(SUBSTRING "${NATIVE_INSTALLED_DIR}" 2 -1 INSTALLED_DIR_WITHOUT_DRIVE)
string(SUBSTRING "${NATIVE_PACKAGES_DIR}" 2 -1 PACKAGES_DIR_WITHOUT_DRIVE)
string(SUBSTRING "${NATIVE_INSTALLED_DIR}" 0 2 INSTALLED_DRIVE)
string(SUBSTRING "${NATIVE_PACKAGES_DIR}" 0 2 PACKAGES_DRIVE)
else()
set(INSTALLED_DRIVE)
set(PACKAGES_DRIVE)
set(INSTALLED_DIR_WITHOUT_DRIVE ${NATIVE_INSTALLED_DIR})
set(PACKAGES_DIR_WITHOUT_DRIVE ${NATIVE_PACKAGES_DIR})
endif()
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR)
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR)
file(GLOB_RECURSE MAKEFILES "${BUILD_DIR}/*Makefile*")
foreach(MAKEFILE ${MAKEFILES})
file(READ "${MAKEFILE}" _contents)
#Set the correct install directory to packages
string(REPLACE "${INSTALLED_DRIVE}$(INSTALL_ROOT)${INSTALLED_DIR_WITHOUT_DRIVE}" "${PACKAGES_DRIVE}$(INSTALL_ROOT)${PACKAGES_DIR_WITHOUT_DRIVE}" _contents "${_contents}")
file(WRITE "${MAKEFILE}" "${_contents}")
endforeach()
endfunction()

View File

@@ -0,0 +1,15 @@
function(qt_fix_prl PACKAGE_DIR PRL_FILES)
file(TO_CMAKE_PATH "${PACKAGE_DIR}/lib" CMAKE_LIB_PATH)
file(TO_CMAKE_PATH "${PACKAGE_DIR}/include/qt5" CMAKE_INCLUDE_PATH)
file(TO_CMAKE_PATH "${PACKAGE_DIR}/include" CMAKE_INCLUDE_PATH2)
file(TO_CMAKE_PATH "${CURRENT_INSTALLED_DIR}" CMAKE_INSTALLED_PREFIX)
foreach(PRL_FILE IN LISTS PRL_FILES)
file(READ "${PRL_FILE}" _contents)
string(REPLACE "${CMAKE_LIB_PATH}" "\$\$[QT_INSTALL_LIBS]" _contents "${_contents}")
string(REPLACE "${CMAKE_INCLUDE_PATH}" "\$\$[QT_INSTALL_HEADERS]" _contents "${_contents}")
string(REPLACE "${CMAKE_INCLUDE_PATH2}" "\$\$[QT_INSTALL_HEADERS]/../" _contents "${_contents}")
string(REPLACE "${CMAKE_INSTALLED_PREFIX}" "\$\$[QT_INSTALL_PREFIX]" _contents "${_contents}")
#Note: This only works without an extra if case since QT_INSTALL_PREFIX is the same for debug and release
file(WRITE "${PRL_FILE}" "${_contents}")
endforeach()
endfunction()

View File

@@ -0,0 +1,18 @@
#Could probably be the beginning of a vcpkg_install_copyright?
function(qt_install_copyright SOURCE_PATH)
#Find the relevant license file and install it
if(EXISTS "${SOURCE_PATH}/LICENSE.LGPLv3")
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPLv3")
elseif(EXISTS "${SOURCE_PATH}/LICENSE.LGPL3")
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.LGPL3")
elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPLv3")
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPLv3")
elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3")
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3")
elseif(EXISTS "${SOURCE_PATH}/LICENSE.GPL3-EXCEPT")
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.GPL3-EXCEPT")
elseif(EXISTS "${SOURCE_PATH}/LICENSE.FDL")
set(LICENSE_PATH "${SOURCE_PATH}/LICENSE.FDL")
endif()
file(INSTALL ${LICENSE_PATH} DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
endfunction()

View File

@@ -0,0 +1,14 @@
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
#Basic setup
include(qt_port_hashes)
#Fixup scripts
include(qt_fix_makefile_install)
include(qt_fix_cmake)
include(qt_fix_prl)
#Helper functions
include(qt_download_submodule)
include(qt_build_submodule)
include(qt_install_copyright)
include(qt_submodule_installation)

View File

@@ -0,0 +1,72 @@
# Every update requires an update of these hashes and the version within the control file of each of the 32 ports.
# So it is probably better to have a central location for these hashes and let the ports update via a script
set(QT_MAJOR_MINOR_VER 5.15)
set(QT_PATCH_VER 4)
set(QT_UPDATE_VERSION 0) # Switch to update qt and not build qt. Creates a file cmake/qt_new_hashes.cmake in qt5-base with the new hashes.
set(QT_PORT_LIST base 3d activeqt charts connectivity datavis3d declarative gamepad graphicaleffects imageformats location macextras mqtt multimedia networkauth
purchasing quickcontrols quickcontrols2 remoteobjects script scxml sensors serialport speech svg tools virtualkeyboard webchannel websockets
webview winextras xmlpatterns doc x11extras androidextras translations serialbus webengine webglplugin wayland)
set(QT_HASH_qt5-base 91a1d95c2891939ae55134e8897cbc423142bd8eda954a1e65bb563b0932ed9e2da34db374fd86858b4a819e8abe824a967b31f4fb316528ec8aaf15016c6ad3)
set(QT_HASH_qt5-3d cb2ea961109a153e78147450310408f4f573186d12412ebdd71511eb273ca78113d3aede583ec8aa44fe19f5268bb6fab3386c5501142ad6a22e10890ce52f62)
set(QT_HASH_qt5-activeqt 39ef01523583cbdea80143fae25afb1cfeb7131769430ab153a82edd6c5478383c558a06ea7053b8d99b8945a6422c4f38765ffb72cd87f0f34cc9ad78ebc603)
set(QT_HASH_qt5-androidextras 527471c0dc9b51ffccdb6c8134b78be4f6d2039bc8dee22529a117457e8153aaf1b081e23704864cc6999ba3059876a85bd3a27b9bcc9fbfda618816c92b719b)
set(QT_HASH_qt5-charts e7a4cac3b3a0c60c7ab509d5a533521dd8dc0cb5ad69d66a87f12671c73c1928d902e0be377efb77e0ddadefe1ef8800c0cf07e8213f44367bcd80a787342bcf)
set(QT_HASH_qt5-connectivity 3f2c0a59ff6be9531f5ebc81a4344e0b12c8ef92fbfa466f2777d4ed3b4b08657214e93e0aada856a0c6475b6b760aeeb06f0b2be894e61cd7b344c49fefaf95)
set(QT_HASH_qt5-datavis3d 044cdee342ef4d9beb62b910cee59f9cb362c85d517e19a1c0327dfa2b518b2fa484e36756ee9302fb043cc506340b501202861a858d374a5f69cbcddec18301)
set(QT_HASH_qt5-declarative 8a4ff61238fde7cc563f9d94b5d1f4fd71ecb95ace447e57d08f71da82400b37c42f4f1ecdcd561116bffa1ed483219e06fb550f91c90842e5a43487bc4706b6)
set(QT_HASH_qt5-doc 2552501dfbc5ad8e42f211a621340902fa85634bc8a2a62ce457029d6f7cbd534a29a671c33aa1d034198a1491fd6d257db7177b0ca5e1ef57b84272a392cf06)
set(QT_HASH_qt5-gamepad 37eaad5338b6c5114571c6983fb806ff6537ba7d3dc4bf8d02899e693198a22ce17b0b3ddf2aa52447fcebb0ef97a3baa8e1bc3a7e3f265ad047509f53160ee9)
set(QT_HASH_qt5-graphicaleffects 00cf02057dfc1624c84079e1a08a65ceb6fb7df712f05ac9cb0006de0add9241e56a8e3909eeb04d1f6a90d5032909a41d59341e002750ab99d2449f635e64e3)
set(QT_HASH_qt5-imageformats 388a9ceebdca6d32f606615af37233f2d8394856d067c9a80486b88ad5714eac90263cd6555a3efd9c1b5fdcc27431b7f99eed6fc02760b1a9974515bfe70274)
set(QT_HASH_qt5-location 6208052d6ac173d19dc77496d8108558e7f31696dc5792fcbbeef2029539db76a60c5a51a7d198f54ea6c0ec23977a57cd8c8f8fa80fe5eac9528d2510c3dbb3)
set(QT_HASH_qt5-macextras 93985001db49985c69360dc58f6260ce2e26f861696c2f5989be9da3e239292fa5b954e0d036869a2e3d6fb046053e39ae113e4307ec762d8db1aa17af1998f5)
set(QT_HASH_qt5-mqtt 7a81d0bec0c59cb5574e96a2f9b33c0eea04789731909247544d14c87a0fa854214b8bfd35ee69831747e9487b616b75bbc9dfd9e78f33acd6b7a69dfaacdd75)
set(QT_HASH_qt5-multimedia bb0ada7560093b89751b5b3c0e1a573de215a388d621d356bc3c0e1acfffc2d696230c67b7a7cef037b18c4da900c7eb3d315bd2e73ce12f9aedd0e340399117)
set(QT_HASH_qt5-networkauth a36ce21151cb98bcbc99a819e873ef10f68d988aebfbae9aaaa7dc85bd4a693ad7510c47627f0f3841c5ef50173b21cdebe6a602fa429839fd9ad9bcc02d6c3c)
set(QT_HASH_qt5-purchasing 6455cff7b3dd2bbf5fc85ba9067b86bb042723b73d0b8984ab43ffdf444e50b5a68bb992ec82b133ac0e0cc3e18ca784cff8357e1e61ffe9fbbef1ff0f21a55f)
set(QT_HASH_qt5-quickcontrols 887a8f5fdcd3764575f9068ec8428526a049bb09ae0c214daef3652527d5e448baa53738dccf316b20ccf18f36951ecebd570aee3a27f9c32b9213ef7629de10)
set(QT_HASH_qt5-quickcontrols2 4ebbb0199db156307140406b6da4fa83c47aee2105e8c46c0da96313ddc4d6d7ea2f1f85691856144eb8c5109c108bb6810ba0693a2d2411b4feaeed1ec9a8f4)
set(QT_HASH_qt5-remoteobjects 6702f9419d5198572e37f0ee6883c2af38f4a249036365d9e084cd4acb30478f6935835493330b101482e998153d4e4f515004e0ffd428b64a86bba17eb203d6)
set(QT_HASH_qt5-script 01d3b03eec23f462a7931e268eb8572d85ed560dd8b24f85b420ff8ebb1932d4c18f47c8d5fad7b7c09c147158b02b6cceb9c571b10249ba4008b363e23d7f95)
set(QT_HASH_qt5-scxml 2664e4e707fd10aa2ef832fdfc133695da3f6f80c2a611dc94b4e22b34c3226d5baa1e5afc77db2115317c654460ebb60896c006aa93b324fe67d6860ae9b431)
set(QT_HASH_qt5-sensors b8b9ffedfdcd392bd5c1ab76db3f621d16094f444e14900726378a289c04c08a75b82628cb61f4ca66bba8c1eeba2a56d9f90d9a82adfdc90fc00ac1b579c63e)
set(QT_HASH_qt5-serialbus 931362b171799fd8e449d418c3ae80c029c39edffc66b5c3fa054991332950241803d282e1ae1e5f72c8395f88f9d82d6a2d04f00b3907b5e9f7fb5be4f555e7)
set(QT_HASH_qt5-serialport d8bc3d0b89bb4fc05bfe27a4c76bc3732ef5f8ba889400c8116f18c2ed58db7a3b99c4bda1cd60d1e8051121d31a4b55b95d20e89578a6e523d527e6182262ba)
set(QT_HASH_qt5-speech 6582fe36950aee8428c72582ff2eda2dae433ad969c323e0c6e8be611be7d81766ceb1cae85a10dcd4d266e33a0cf782fe857e1502d7f3863e0dfb2306af2aed)
set(QT_HASH_qt5-svg 364400e17cdc659ff1a521f7bd171c5dfe537136f263cd5f64c6b5e27b0398d83ae0b5fe46e77847f3a2feccf0ea75f9591ff4b932d0250e5859272630b5a31c)
set(QT_HASH_qt5-tools 26edf546a1ec7195f1ff5a9e40e430fdd0c7ebb7d86e44ed22b093426c23ff25b2c972fa520abd1064369d32609019746c2fe972a3f593c6f7539d339642f06e)
set(QT_HASH_qt5-translations 56b20c0174cb68c3e4def85ec6c113576bc8872d1cdac318bc3d9a121645f67ce68e9bd3a73e32fd53617fcef641fb95831b37c40f1250c1c05e109e55b41ee2)
set(QT_HASH_qt5-virtualkeyboard 870279299a5e166badea0746a2d4badc758c66f8404e36d1df05997dcfeb66733154fc2a9830c433fbacf885b7afb44bc8dc8a5aacc02713966630ce98231ba3)
set(QT_HASH_qt5-wayland 58ae262f7aa0455fb577a36fe9413a969398a2043160642501bac064d6fbc3280f76aa566e62b9d73c67a8c3606849b1b97bcb9b0250d26c269ec921112f40e4)
set(QT_HASH_qt5-webchannel 18d5e6f44b780c7dfc94e1620ba76d7b0731d671df537b2e29fef062a0775e8dc973deb6c949b37000f5e8a49bdd31a723aa069bafcb9ecdc3259d0bf97e5a26)
set(QT_HASH_qt5-webengine 935c5a21ec2529d8cc3dbaf906e1f68f6e0879da212719d2da9fc1c97efd572563e8d12a6742a0a995efa5014ce5378235833eafb8d463ebe4060b60a590c476)
set(QT_HASH_qt5-webglplugin e637abc9388f6c9c6641a38c7f33cef781320616be7d181d7fc63aa6f3ed6d378ec3cef91c8feebda52ff669bb3eb2df771bc2a2e447d482ce940abe4c1edce9)
set(QT_HASH_qt5-websockets 01714b9927c3a234fac9386a596aa3dc3833d9cfe8cc152892fec969e51b428bed00f501c16b8e4f810452739ff8491e5c64f9b936aa10e1a839c09c8f2832ce)
set(QT_HASH_qt5-webview fb5177f0e8f79490598120f01b6cdd78ce5cbac8f313c0e088ded7b4daada290d2c058ecd6eebdba76fd15efd2e198bc03cbaf544fba664d49efb55709703be6)
set(QT_HASH_qt5-winextras cac1b2b2194f3c21cba73e0c49384957a40e3297965b3fcf625eba0d069e3955202cae5e545a6186a9fad51df18afddd27fe55535265d2acf15fe2ba9e71a1d5)
set(QT_HASH_qt5-x11extras 79c718eff9daba9ff3f361d38f828f8f3c447b87486d652d4ed1f964ec686259ae4d0a1a50b7b6b9349453ba3f8b56b3c20c8a5f26971d5cc3c8f99d668744d6)
set(QT_HASH_qt5-xmlpatterns fc4b4723407f6a1e765933d9d76ec4ffe874cb4a70e47bc4110def2c4a491b86fa753c33ef31ef95ad1a6eaa3de1fadbc49deb7783d32d8fc2f51672670d5a87)
if(QT_UPDATE_VERSION)
message(STATUS "Running Qt in automatic version port update mode!")
set(_VCPKG_INTERNAL_NO_HASH_CHECK 1)
if("${PORT}" MATCHES "qt5-base")
function(update_qt_version_in_manifest _port_name)
set(_current_control "${VCPKG_ROOT_DIR}/ports/${_port_name}/vcpkg.json")
file(READ ${_current_control} _control_contents)
#message(STATUS "Before: \n${_control_contents}")
string(REGEX REPLACE "\"version.*\": \"[0-9]+\.[0-9]+\.[0-9]+\",\n" "\"version\": \"${QT_MAJOR_MINOR_VER}.${QT_PATCH_VER}\",\n" _control_contents "${_control_contents}")
string(REGEX REPLACE "\n \"port-version\": [0-9]+," "" _control_contents "${_control_contents}")
#message(STATUS "After: \n${_control_contents}")
file(WRITE ${_current_control} "${_control_contents}")
configure_file("${_current_control}" "${_current_control}" @ONLY NEWLINE_STYLE LF)
endfunction()
update_qt_version_in_manifest("qt5")
foreach(_current_qt_port_basename ${QT_PORT_LIST})
update_qt_version_in_manifest("qt5-${_current_qt_port_basename}")
endforeach()
endif()
endif()

View File

@@ -0,0 +1,15 @@
function(qt_submodule_installation)
cmake_parse_arguments(_csc "" "OUT_SOURCE_PATH" "" ${ARGN})
qt_download_submodule(OUT_SOURCE_PATH TARGET_SOURCE_PATH ${_csc_UNPARSED_ARGUMENTS})
if(QT_UPDATE_VERSION)
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled PARENT_SCOPE)
else()
qt_build_submodule(${TARGET_SOURCE_PATH} ${_csc_UNPARSED_ARGUMENTS})
qt_install_copyright(${TARGET_SOURCE_PATH})
endif()
if(DEFINED _csc_OUT_SOURCE_PATH)
set(${_csc_OUT_SOURCE_PATH} ${TARGET_SOURCE_PATH} PARENT_SCOPE)
endif()
endfunction()