Skip to content

Commit

Permalink
[Qt6] Fix Qt6.3 windeployqt (#24445)
Browse files Browse the repository at this point in the history
* move windeploylogic to qtbase.
fix qtpaths for debug.

* fix missing stuff

* version stuff

* add supports !uwp since qt6 dropped uwp support

* version stuff

* add newline. Fix BAKCD

* version stuff

* use enabledelayedexpansion

* version stuff

* use cd /D

* version stuff

Co-authored-by: Alexander Neumann <you@example.com>
  • Loading branch information
Neumann-A and Alexander Neumann committed May 5, 2022
1 parent fd6a336 commit c648581
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 20 deletions.
31 changes: 25 additions & 6 deletions ports/qtbase/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -404,16 +404,35 @@ if(VCPKG_TARGET_IS_WINDOWS)
file(COPY ${DLLS_TO_COPY} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin")
endif()

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/qmake.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin")
set(hostinfofile "${CURRENT_PACKAGES_DIR}/share/Qt6HostInfo/Qt6HostInfoConfig.cmake")
file(READ "${hostinfofile}" _contents)
string(REPLACE [[set(QT6_HOST_INFO_LIBEXECDIR "bin")]] [[set(QT6_HOST_INFO_LIBEXECDIR "tools/Qt6/bin")]] _contents "${_contents}")
string(REPLACE [[set(QT6_HOST_INFO_BINDIR "bin")]] [[set(QT6_HOST_INFO_BINDIR "tools/Qt6/bin")]] _contents "${_contents}")
file(WRITE "${hostinfofile}" "${_contents}")

set(coretools "${CURRENT_PACKAGES_DIR}/share/Qt6CoreTools/Qt6CoreTools.cmake")
if(EXISTS "${coretools}")
file(READ "${coretools}" _contents)
string(REPLACE [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.exe"]] [["${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.debug.bat"]] _contents "${_contents}")
file(WRITE "${coretools}" "${_contents}")
if(QT_IS_LATEST)
set(configfile "${CURRENT_PACKAGES_DIR}/share/Qt6CoreTools/Qt6CoreToolsTargets-debug.cmake")
if(EXISTS "${configfile}")
file(READ "${configfile}" _contents)
if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/qmake.exe")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/qmake.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin")
string(REPLACE [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.exe"]] [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.debug.bat"]] _contents "${_contents}")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/qtpaths.exe")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/qtpaths.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin")
string(REPLACE [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qtpaths.exe"]] [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qtpaths.debug.bat"]] _contents "${_contents}")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/windeployqt.exe")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/windeployqt.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin")
string(REPLACE [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.exe"]] [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.debug.bat"]] _contents "${_contents}")
endif()
file(WRITE "${configfile}" "${_contents}")
endif()
else()
set(coretools "${CURRENT_PACKAGES_DIR}/share/Qt6CoreTools/Qt6CoreTools.cmake")
if(EXISTS "${coretools}")
file(READ "${coretools}" _contents)
string(REPLACE [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.exe"]] [[ "${_IMPORT_PREFIX}/tools/Qt6/bin/qmake.debug.bat"]] _contents "${_contents}")
file(WRITE "${coretools}" "${_contents}")
endif()
endif()
2 changes: 1 addition & 1 deletion ports/qtbase/qmake.debug.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
"%0\..\qmake.exe" -qtconf "%0\..\qt.debug.conf" %*
"%0\..\qmake.exe" -qtconf "%0\..\qt.debug.conf" %*
2 changes: 2 additions & 0 deletions ports/qtbase/qtpaths.debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
"%0\..\qtpaths.exe" --qtconf "%0\..\qt.debug.conf" %*
2 changes: 2 additions & 0 deletions ports/qtbase/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "qtbase",
"version": "6.3.0",
"port-version": 1,
"description": "Qt Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.",
"homepage": "https://www.qt.io/",
"license": null,
"supports": "!uwp",
"dependencies": [
"freetype",
{
Expand Down
10 changes: 10 additions & 0 deletions ports/qtbase/windeployqt.debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
setlocal enabledelayedexpansion
set mypath=%~dp0
set mypath=%mypath:~0,-1%
set BAKCD=!CD!
cd /D %mypath%\..\..\..\debug\bin
set PATH=!CD!;%PATH%
"%mypath%\windeployqt.exe" --qtpaths "%mypath%\qtpaths.debug.bat" %*
cd %BAKCD%
endlocal
14 changes: 8 additions & 6 deletions ports/qttools/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,14 @@ if(VCPKG_TARGET_IS_OSX)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

set(configfile "${CURRENT_PACKAGES_DIR}/share/Qt6ToolsTools/Qt6ToolsToolsTargets-debug.cmake")
if(EXISTS "${configfile}" AND EXISTS "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/windeployqt.exe")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/windeployqt.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin")
file(READ "${configfile}" _contents)
string(REPLACE [[${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.exe]] [[${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.debug.bat]] _contents "${_contents}")
file(WRITE "${configfile}" "${_contents}")
if(NOT QT_IS_LATEST)
set(configfile "${CURRENT_PACKAGES_DIR}/share/Qt6CoreTools/Qt6CoreToolsTargets-debug.cmake")
if(EXISTS "${configfile}" AND EXISTS "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/windeployqt.exe")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/windeployqt.debug.bat" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin")
file(READ "${configfile}" _contents)
string(REPLACE [[${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.exe]] [[${_IMPORT_PREFIX}/tools/Qt6/bin/windeployqt.debug.bat]] _contents "${_contents}")
file(WRITE "${configfile}" "${_contents}")
endif()
endif()

file(GLOB_RECURSE debug_dir "${CURRENT_PACKAGES_DIR}/debug/*")
Expand Down
1 change: 1 addition & 0 deletions ports/qttools/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "qttools",
"version": "6.3.0",
"port-version": 1,
"description": "Qt Tools",
"homepage": "https://www.qt.io/",
"license": null,
Expand Down
10 changes: 5 additions & 5 deletions ports/qttools/windeployqt.debug.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@echo off
setlocal
setlocal enabledelayedexpansion
set mypath=%~dp0
set mypath=%mypath:~0,-1%
cd %mypath%\..\..\..\debug\bin
set BAKCD=%CD%
set PATH=%CD%;%PATH%
set BAKCD=!CD!
cd /D %mypath%\..\..\..\debug\bin
set PATH=!CD!;%PATH%
"%mypath%\windeployqt.exe" --qmake "%mypath%\qmake.debug.bat" %*
cd %BAKCD%
endlocal
endlocal
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5862,7 +5862,7 @@
},
"qtbase": {
"baseline": "6.3.0",
"port-version": 0
"port-version": 1
},
"qtcharts": {
"baseline": "6.3.0",
Expand Down Expand Up @@ -5978,7 +5978,7 @@
},
"qttools": {
"baseline": "6.3.0",
"port-version": 0
"port-version": 1
},
"qttranslations": {
"baseline": "6.3.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": "32ffa659c93542477ed0f0ee90f3a7f99c0035f0",
"version": "6.3.0",
"port-version": 1
},
{
"git-tree": "8a107123c1e35b7e5fc0df157026d7fde8a42632",
"version": "6.3.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/q-/qttools.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4bef4075be6e9e33ada53f0e2b3a37329187fa5a",
"version": "6.3.0",
"port-version": 1
},
{
"git-tree": "002b7b9432d4c1f49de7a486f70a673285cd98a8",
"version": "6.3.0",
Expand Down

0 comments on commit c648581

Please sign in to comment.