Skip to content
28 changes: 25 additions & 3 deletions ports/qtbase/cmake/qt_install_submodule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ if(NOT DEFINED QT6_DIRECTORY_PREFIX)
set(QT6_DIRECTORY_PREFIX "Qt6/")
endif()

if(VCPKG_TARGET_IS_ANDROID AND NOT ANDROID_SDK_ROOT)
message(FATAL_ERROR "${PORT} requires ANDROID_SDK_ROOT to be set. Consider adding it to the triplet." )
if(VCPKG_TARGET_IS_ANDROID)
# ANDROID_HOME: canonical SDK environment variable
# ANDROID_SDK_ROOT: legacy qtbase triplet variable
if(NOT ANDROID_SDK_ROOT)
if("$ENV{ANDROID_HOME}" STREQUAL "")
message(FATAL_ERROR "${PORT} requires environment variable ANDROID_HOME to be set.")
endif()
set(ANDROID_SDK_ROOT "$ENV{ANDROID_HOME}")
endif()
endif()

function(qt_download_submodule_impl)
Expand Down Expand Up @@ -210,7 +217,14 @@ function(qt_cmake_configure)
INPUT_xcb
INPUT_xkbcommon
)
set(Z_VCPKG_CMAKE_GENERATOR "${Z_VCPKG_CMAKE_GENERATOR}" PARENT_SCOPE)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Z_VCPKG_CMAKE_GENERATOR is a cache variable owned by vcpkg-cmake.

foreach(suffix IN ITEMS dbg rel)
if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${suffix}/config.summary")
file(COPY_FILE
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${suffix}/config.summary"
"${CURRENT_BUILDTREES_DIR}/config.summary-${TARGET_TRIPLET}-${suffix}.log"
)
endif()
endforeach()
endfunction()

function(qt_fix_prl_files)
Expand Down Expand Up @@ -341,6 +355,14 @@ function(qt_install_submodule)

qt_download_submodule(PATCHES ${_qis_PATCHES})

if(VCPKG_TARGET_IS_ANDROID)
# Qt only supports dynamic linkage on Android,
# https://bugreports.qt.io/browse/QTBUG-32618.
# It requires libc++_shared, cf. <qtbase>/cmake/QtPlatformAndroid.cmake
# and https://developer.android.com/ndk/guides/cpp-support#sr
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
endif()

if(_qis_DISABLE_NINJA)
set(_opt DISABLE_NINJA)
endif()
Expand Down
23 changes: 20 additions & 3 deletions ports/qtbase/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT "doubleconversion" IN_LIST FEATURES)
message(FATAL_ERROR "${PORT} requires feature doubleconversion on windows!" )
endif()

# Feature like glib depend on pkg-config
vcpkg_find_acquire_program(PKGCONFIG)
set(ENV{PKG_CONFIG} "${PKGCONFIG}")

if(VCPKG_TARGET_IS_LINUX)
message(WARNING "qtbase currently requires packages from the system package manager. "
"They can be installed on Ubuntu systems via sudo apt-get install "
Expand Down Expand Up @@ -121,7 +125,7 @@ FEATURES
"icu" FEATURE_icu
"pcre2" FEATURE_pcre2
#"icu" CMAKE_REQUIRE_FIND_PACKAGE_ICU
"glib" CMAKE_REQUIRE_FIND_PACKAGE_GLIB2
#"glib" CMAKE_REQUIRE_FIND_PACKAGE_GLIB2
Comment on lines -124 to +128
Copy link
Contributor Author

@dg0yt dg0yt May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple attempts, success on second one.

(Drive-by fix, based on feature-tests. Complemented by acquiring PKGCONFIG.)

INVERTED_FEATURES
#"doubleconversion" CMAKE_DISABLE_FIND_PACKAGE_WrapDoubleConversion # Required
#"pcre2" CMAKE_DISABLE_FIND_PACKAGE_WrapSystemPCRE2 # Bug in qt cannot be deactivated
Expand Down Expand Up @@ -158,7 +162,7 @@ else()
list(APPEND FEATURE_NET_OPTIONS -DINPUT_openssl=no)
endif()

if ("dnslookup" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS)
if ("dnslookup" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_ANDROID AND NOT VCPKG_TARGET_IS_WINDOWS)
list(APPEND FEATURE_NET_OPTIONS -DFEATURE_libresolv:BOOL=ON)
endif()

Expand Down Expand Up @@ -332,11 +336,13 @@ qt_install_submodule(PATCHES ${${PORT}_PATCHES}
-DINPUT_bundled_xcb_xinput:STRING=no
-DFEATURE_force_debug_info:BOOL=ON
-DFEATURE_relocatable:BOOL=ON
-DQT_AUTODETECT_ANDROID:BOOL=ON # Use vcpkg toolchain as is
CONFIGURE_OPTIONS_RELEASE
CONFIGURE_OPTIONS_DEBUG
-DFEATURE_debug:BOOL=ON
CONFIGURE_OPTIONS_MAYBE_UNUSED
FEATURE_appstore_compliant # only used for android/ios
QT_AUTODETECT_ANDROID
)

# Install CMake helper scripts
Expand Down Expand Up @@ -411,6 +417,11 @@ foreach(_config debug release)
endif()
endforeach()
endforeach()
if(VCPKG_CROSSCOMPILING AND NOT CMAKE_HOST_WIN32)
foreach(name IN ITEMS qmake qmake6 qtpaths qtpaths6)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/${name}" "${CURRENT_HOST_INSTALLED_DIR}/" "\"\$script_dir_path\"/../../../../${HOST_TRIPLET}/")
endforeach()
endif()

# Fixup qt.toolchain.cmake
set(qttoolchain "${CURRENT_PACKAGES_DIR}/share/Qt6/qt.toolchain.cmake")
Expand Down Expand Up @@ -489,11 +500,17 @@ if(EXISTS "${target_qt_conf}")
endif()
endif()

if(VCPKG_TARGET_IS_ANDROID)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/Qt6Core/Qt6AndroidMacros.cmake"
[[ set(cmake_dir "${prefix_path}/${${export_namespace_upper}_INSTALL_LIBS}/cmake")]]
[[ set(cmake_dir "${prefix_path}/share")]]
)
endif()

if(VCPKG_TARGET_IS_EMSCRIPTEN)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/Qt6Core/Qt6WasmMacros.cmake" "_qt_test_emscripten_version()" "") # this is missing a include(QtPublicWasmToolchainHelpers)
endif()


if(VCPKG_TARGET_IS_WINDOWS)
set(_DLL_FILES brotlicommon brotlidec bz2 freetype harfbuzz libpng16)
set(DLLS_TO_COPY "")
Expand Down
24 changes: 19 additions & 5 deletions ports/qtbase/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "qtbase",
"version": "6.8.3",
"port-version": 1,
"port-version": 2,
"description": "Qt Base (Core, Gui, Widgets, Network, ...)",
"homepage": "https://www.qt.io/",
"license": null,
Expand Down Expand Up @@ -31,17 +31,19 @@
"name": "qtbase",
"default-features": false,
"features": [
"cups"
"cups",
"thread"
],
"platform": "osx"
},
{
"name": "qtbase",
"default-features": false,
"features": [
"concurrent",
"thread"
],
"platform": "osx"
"platform": "android"
},
{
"name": "qtbase",
Expand Down Expand Up @@ -70,7 +72,7 @@
"concurrent",
{
"name": "dbus",
"platform": "!(static & windows)"
"platform": "!(static & windows) & !android"
},
"dnslookup",
"doubleconversion",
Expand Down Expand Up @@ -208,19 +210,21 @@
},
"egl": {
"description": "EGL",
"supports": "linux",
"supports": "android | linux",
"dependencies": [
"egl"
]
},
"fontconfig": {
"description": "Use fontconfig",
"supports": "!osx & !windows",
"dependencies": [
"fontconfig",
{
"name": "qtbase",
"default-features": false,
"features": [
"freetype",
"gui"
]
}
Expand Down Expand Up @@ -307,6 +311,16 @@
],
"platform": "osx"
},
{
"name": "qtbase",
"default-features": false,
"features": [
"egl",
"gles2",
"opengl"
],
"platform": "android"
},
{
"name": "qtbase",
"default-features": false,
Expand Down
5 changes: 2 additions & 3 deletions ports/vcpkg-qmake/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "vcpkg-qmake",
"version-date": "2023-03-22",
"port-version": 3,
"documentation": "https://vcpkg.io/en/docs/README.html",
"version-date": "2025-05-19",
"documentation": "https://learn.microsoft.com/vcpkg/maintainers/functions/vcpkg_qmake_configure",
"license": "MIT",
"supports": "native",
"dependencies": [
Expand Down
28 changes: 18 additions & 10 deletions ports/vcpkg-qmake/vcpkg_qmake_configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,25 @@ function(vcpkg_qmake_configure)
endif()

function(qmake_append_program var qmake_var value)
get_filename_component(prog "${value}" NAME)
# QMake assumes everything is on PATH?
vcpkg_list(APPEND ${var} "${qmake_var}=${prog}")
find_program(${qmake_var} NAMES "${prog}")
cmake_path(COMPARE "${${qmake_var}}" EQUAL "${value}" correct_prog_on_path)
if(NOT correct_prog_on_path AND NOT "${value}" MATCHES "|:")
message(FATAL_ERROR "Detect path mismatch for '${qmake_var}'. '${value}' is not the same as '${${qmake_var}}'. Please correct your PATH!")
# Danger zone: qmake poorly handles tools in C:/Program Files etc.
# IOW for MSVC it expects short command names, found via PATH.
if(value MATCHES " ")
get_filename_component(prog "${value}" NAME)
find_program("z_vcpkg_qmake_${qmake_var}" NAMES "${prog}" PATHS ENV PATH NO_DEFAULT_PATH NO_CACHE)
cmake_path(COMPARE "${z_vcpkg_qmake_${qmake_var}}" EQUAL "${value}" expected_program_in_path)
if(NOT expected_program_in_path)
message(FATAL_ERROR
"Detected path mismatch for '${qmake_var}=${prog}'.\n"
" Actual: ${z_vcpkg_qmake_${qmake_var}}\n"
" Expected: ${value}\n"
"Please correct environment variable PATH!"
)
endif()
else()
set(prog "${value}")
endif()
unset(${qmake_var})
unset(${qmake_var} CACHE)
set(${var} "${${var}}" PARENT_SCOPE) # Is this correct? Or is there a vcpkg_list command for that?
vcpkg_list(APPEND "${var}" "${qmake_var}=${prog}")
set("${var}" "${${var}}" PARENT_SCOPE)
endfunction()
# Setup Build tools
if(NOT VCPKG_QMAKE_COMMAND) # For users using outside Qt6
Expand Down
16 changes: 16 additions & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,9 @@ python3:x64-android=fail
qpid-proton:arm64-uwp=fail
qpid-proton:x64-uwp=fail
qpid-proton:x64-windows-static=fail
qt-advanced-docking-system:arm-neon-android=fail
qt-advanced-docking-system:arm64-android=fail
qt-advanced-docking-system:x64-android=fail
qt5-base:arm-neon-android=fail
qt5-base:arm64-android=fail
qt5-base:arm64-windows-static-md=fail
Expand All @@ -829,6 +832,15 @@ qt5-webengine:x86-windows=skip
# Missing system libraries
qt5-x11extras:arm64-osx=skip
qt5-x11extras:x64-osx=skip
qtmultimedia:arm-neon-android=fail
qtmultimedia:arm64-android=fail
qtmultimedia:x64-android=fail
qtquick3d:arm-neon-android=fail
qtquick3d:arm64-android=fail
qtquick3d:x64-android=fail
qtwayland:arm-neon-android=fail
qtwayland:arm64-android=fail
qtwayland:x64-android=fail
# Missing system libraries
qtwayland:arm64-osx=skip
qtwayland:x64-osx=skip
Expand Down Expand Up @@ -1110,6 +1122,10 @@ qt:x64-windows-release=pass
qt:x64-windows-static-md=pass
qt:x64-windows-static=pass
qt:x64-windows=pass
# qt:*-android=pass : qtmultimedia, qtquick3d, qtwayland fail
qtbase:arm-neon-android=pass
qtbase:arm64-android=pass
qtbase:x64-android=pass
vcpkg-ci-arrow:x64-linux=pass
vcpkg-ci-arrow:x64-osx=pass
vcpkg-ci-arrow:x64-windows-release=pass
Expand Down
9 changes: 7 additions & 2 deletions scripts/ci.feature.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,17 @@ qbittorrent:x64-osx=fail # Not yet ready for these platforms.
qpid-proton:arm-uwp=fail
qpid-proton:x64-uwp=fail
qpid-proton:x64-windows-static=fail
qt-advanced-docking-system(android)=fail
qt5-base:arm64-windows=fail
qt5-canvas3d=skip # Skip deprecated Qt module (remove after 1 year or longer due to vcpkg upgrade not handling removed ports correctly)
qt5-wayland:x64-osx=fail # Missing system libraries
qt5-webengine = fail # Missing prerequisites for CI success
qt5-x11extras(osx)=fail # Missing system libraries
qt5-x11extras(windows)=fail # Missing libraries
qtmultimedia(android)=fail
qtquick3d(android)=fail
qtvirtualkeyboard[t9write] = skip # depends on the port 't9write' that does not exists
qtwayland(osx)=fail # Missing system libraries
qtwayland(android | osx)=fail # Missing system libraries
qwt-qt6:x64-osx=fail
rapidstring:arm-uwp=fail
rapidstring:arm64-windows=fail
Expand Down Expand Up @@ -1836,7 +1839,9 @@ qtactiveqt:x64-uwp = cascade
qtapplicationmanager:arm64-osx = cascade
qtapplicationmanager:arm64-uwp = cascade
qtapplicationmanager:x64-uwp = cascade
qtbase[dbus](android) = cascade
qtbase[sql-mysql]:x86-windows = cascade
qtbase[sql-mysql](android) = cascade
qtcharts:arm64-uwp = cascade
qtcharts:x64-uwp = cascade
qtcoap:arm64-uwp = cascade
Expand Down Expand Up @@ -2255,7 +2260,7 @@ poco[core,mariadb,mysql] = options # You can not install mariadb and mysql at th
qt3d[animation] = options # is a requirement, see https://github.com/microsoft/vcpkg/issues/31336
qt3d[extras] = options # is a requirement, see https://github.com/microsoft/vcpkg/issues/31336
qt5compat[iconv](!uwp) = feature-fails # requires qtbase without icu
qtbase[fontconfig] = feature-fails # see https://github.com/microsoft/vcpkg/issues/31247
qtbase[gles3](android) = feature-fails
qtbase[sql-oci](!(arm & windows)) = feature-fails # see https://github.com/microsoft/vcpkg/issues/32052
qtmultimedia[core,ffmpeg,gstreamer,qml,widgets](osx) = combination-fails # Error: Qt will by default autolink both plugin backends in static builds leading to symbol collisions and a build failure in dependent ports! As such in static builds only one backend is allowed by default.
qtopcua[uacpp](!uwp) = feature-fails # Unified Automation C++ SDK is not installed
Expand Down
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7814,7 +7814,7 @@
},
"qtbase": {
"baseline": "6.8.3",
"port-version": 1
"port-version": 2
},
"qtcharts": {
"baseline": "6.8.3",
Expand Down Expand Up @@ -9777,8 +9777,8 @@
"port-version": 0
},
"vcpkg-qmake": {
"baseline": "2023-03-22",
"port-version": 3
"baseline": "2025-05-19",
"port-version": 0
},
"vcpkg-tool-bazel": {
"baseline": "5.2.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/q-/qtbase.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c6fb64e484a6762f3ea271a486044c6fb0bca96f",
"version": "6.8.3",
"port-version": 2
},
{
"git-tree": "8fadd1802001862cb8fba5b579469c2cb8bb8b30",
"version": "6.8.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/v-/vcpkg-qmake.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "abf9488c79bf3a34c38aa3260e9b3c4778a47d82",
"version-date": "2025-05-19",
"port-version": 0
},
{
"git-tree": "6679e34e75a78732fb13cd74a39dbd358b3fd5d7",
"version-date": "2023-03-22",
Expand Down