• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision7d92fc216f401590ec02574d5500592e05a4af20 (tree)
Time2022-11-19 18:56:23
AuthorFs <Fsu0413@vip....>
CommiterFs

Log Message

CMake tweak of cross builds

Change Summary

Incremental Difference

--- a/qt6_deploy_host.sh
+++ b/qt6_deploy_host.sh
@@ -29,13 +29,15 @@ if [ ! -e "${PATH_TO_HOST}/bin/qt-cmake" ]; then
2929 exit 1
3030 fi
3131
32-mkdir $PATH_TO_TARGET/host
33-cp -R $PATH_TO_HOST/bin $PATH_TO_TARGET/host/
34-[ -d "${PATH_TO_HOST}/libexec" ] && cp -R ${PATH_TO_HOST}/libexec $PATH_TO_TARGET/host/
35-mkdir $PATH_TO_TARGET/host/lib
36-cp -R $PATH_TO_HOST/lib/cmake $PATH_TO_TARGET/host/lib/
37-cp -R $PATH_TO_HOST/lib/metatypes $PATH_TO_TARGET/host/lib/
38-find $PATH_TO_HOST/lib/ -name \*.prl -maxdepth 1 -exec cp '{}' $PATH_TO_TARGET/host/lib ';'
32+mkdir "${PATH_TO_TARGET}/host"
33+cp -R "${PATH_TO_HOST}/bin" "${PATH_TO_TARGET}/host/"
34+[ -d "${PATH_TO_HOST}/libexec" ] && cp -R "${PATH_TO_HOST}/libexec" "${PATH_TO_TARGET}/host/"
35+mkdir "${PATH_TO_TARGET}/host/lib"
36+cp -R "${PATH_TO_HOST}/lib/cmake" "${PATH_TO_TARGET}/host/lib/"
37+cp -R "${PATH_TO_HOST}/lib/metatypes" "${PATH_TO_TARGET}/host/lib/"
38+find "${PATH_TO_HOST}/lib/" -name '*.prl' -maxdepth 1 -exec cp '{}' "${PATH_TO_TARGET}/host/lib" ';'
39+
40+# qmake tweak
3941
4042 (
4143 echo '#!/bin/sh'
@@ -44,16 +46,26 @@ find $PATH_TO_HOST/lib/ -name \*.prl -maxdepth 1 -exec cp '{}' $PATH_TO_TARGET/h
4446 echo "script_dir_path=\`(cd \"\$script_dir_path\"; /bin/pwd)\`"
4547 echo
4648 echo "\$script_dir_path/../host/bin/qmake -qtconf \"\$script_dir_path/target_qt.conf\" \$*"
47-) > $PATH_TO_TARGET/bin/qmake
49+) > "${PATH_TO_TARGET}/bin/qmake"
50+
51+chmod +x "${PATH_TO_TARGET}/bin/qmake"
52+
53+(
54+ echo '#!/bin/sh'
55+ echo
56+ echo "script_dir_path=\`dirname \$0\`"
57+ echo "script_dir_path=\`(cd \"\$script_dir_path\"; /bin/pwd)\`"
58+ echo
59+ echo "\$script_dir_path/../host/bin/qtpaths -qtconf \"\$script_dir_path/target_qt.conf\" \$*"
60+) > "${PATH_TO_TARGET}/bin/qtpaths"
61+
62+chmod +x "${PATH_TO_TARGET}/bin/qtpaths"
4863
49-chmod +x $PATH_TO_TARGET/bin/qmake
64+sed -i -e 's,^HostPrefix=.*$,HostPrefix=../host,g' "${PATH_TO_TARGET}/bin/target_qt.conf"
65+sed -i -e 's,^HostData=.*$,HostData=..,g' "${PATH_TO_TARGET}/bin/target_qt.conf"
5066
51-sed -i -e 's,^HostPrefix=.*$,HostPrefix=../host,g' $PATH_TO_TARGET/bin/target_qt.conf
52-sed -i -e 's,^HostData=.*$,HostData=..,g' $PATH_TO_TARGET/bin/target_qt.conf
67+# CMake tweak
5368
54-# CMake is broken even if we have tried to tweak it
55-# Temporarily put these things off until we found a solution
69+sed -i -e 's,^set(__qt_platform_initial_qt_host_path[[:space:]].*$,set(__qt_platform_initial_qt_host_path "${Qt6_DIR}/../../../host"),' "${PATH_TO_TARGET}/lib/cmake/Qt6/Qt6Dependencies.cmake"
70+sed -i -e 's,^set(__qt_platform_initial_qt_host_path_cmake_dir[[:space:]].*$,set(__qt_platform_initial_qt_host_path "${Qt6_DIR}/../../../host/lib/cmake"),' "${PATH_TO_TARGET}/lib/cmake/Qt6/Qt6Dependencies.cmake"
5671
57-# Currently all we know is that:
58-# Qt provides toolchain file which we'd use
59-# some variable should be modified using 'sed'-like program
--- a/qt6_deploy_host.vbs
+++ b/qt6_deploy_host.vbs
@@ -26,6 +26,7 @@ End If
2626
2727 fso.CreateFolder PATH_TO_TARGET & "\host"
2828 fso.CopyFolder PATH_TO_HOST & "\bin", PATH_TO_TARGET & "\host\bin"
29+If fso.FolderExists(PATH_TO_HOST & "\libexec") Then fso.CopyFolder PATH_TO_HOST & "\libexec", PATH_TO_TARGET & "\host\libexec"
2930 fso.CreateFolder PATH_TO_TARGET & "\host\lib"
3031 fso.CopyFolder PATH_TO_HOST & "\lib\cmake", PATH_TO_TARGET & "\host\lib\cmake"
3132 fso.CopyFolder PATH_TO_HOST & "\lib\metatypes", PATH_TO_TARGET & "\host\lib\metatypes"
@@ -38,6 +39,8 @@ For Each hostlibfile In hostlibdir.Files
3839 End If
3940 Next
4041
42+' qmake tweak
43+
4144 fso.DeleteFile PATH_TO_TARGET & "\bin\qmake.bat"
4245
4346 Dim qmake
@@ -45,6 +48,13 @@ Set qmake = fso.OpenTextFile(PATH_TO_TARGET & "\bin\qmake.bat", 2, True)
4548 qmake.WriteLine """%~dp0\..\host\bin\qmake"" -qtconf ""%~dp0\target_qt.conf"" %*"
4649 qmake.Close
4750
51+fso.DeleteFile PATH_TO_TARGET & "\bin\qtpaths.bat"
52+
53+Dim qtpaths
54+Set qtpaths = fso.OpenTextFile(PATH_TO_TARGET & "\bin\qtpaths.bat", 2, True)
55+qtpaths.WriteLine """%~dp0\..\host\bin\qtpaths"" -qtconf ""%~dp0\target_qt.conf"" %*"
56+qtpaths.Close
57+
4858 Dim target_qtconf
4959 Dim target_qtconfold
5060 Set target_qtconf = fso.OpenTextFile(PATH_TO_TARGET & "\bin\target_qt.conf.new", 2, True)
@@ -64,6 +74,28 @@ target_qtconfold.Close
6474 fso.DeleteFile PATH_TO_TARGET & "\bin\target_qt.conf"
6575 fso.MoveFile PATH_TO_TARGET & "\bin\target_qt.conf.new", PATH_TO_TARGET & "\bin\target_qt.conf"
6676
67-' CMake is broken even if we have tried to tweak it
68-' Temporarily put these things off until we found a solution
77+' CMake tweak
78+
79+Dim Qt6Dependencies_cmake
80+Dim Qt6Dependencies_cmakeold
81+Set Qt6Dependencies_cmake = fso.OpenTextFile(PATH_TO_TARGET & "\lib\cmake\Qt6\Qt6Dependencies.cmake.new", 2, True)
82+Set Qt6Dependencies_cmakeold = fso.OpenTextFile(PATH_TO_TARGET & "\lib\cmake\Qt6\Qt6Dependencies.cmake", 1, False)
83+
84+Do until Qt6Dependencies_cmakeold.AtEndOfStream
85+ Dim line
86+ line = Qt6Dependencies_cmakeold.ReadLine
87+ If Left(Trim(line), 38) = "set(__qt_platform_initial_qt_host_path" Then line = "set(__qt_platform_initial_qt_host_path ""${Qt6_DIR}/../../../host"")"
88+ If Left(Trim(line), 48) = "set(__qt_platform_initial_qt_host_path_cmake_dir" Then line = "set(__qt_platform_initial_qt_host_path_cmake_dir ""${Qt6_DIR}/../../../host/lib/cmake"")"
89+ Qt6Dependencies_cmake.WriteLine line
90+Loop
91+
92+Qt6Dependencies_cmake.Close
93+Qt6Dependencies_cmakeold.Close
94+
95+fso.DeleteFile PATH_TO_TARGET & "\lib\cmake\Qt6\Qt6Dependencies.cmake"
96+fso.MoveFile PATH_TO_TARGET & "\lib\cmake\Qt6\Qt6Dependencies.cmake.new", PATH_TO_TARGET & "\lib\cmake\Qt6\Qt6Dependencies.cmake"
6997
98+' lib/cmake/Qt6/QtBuildInternalsExtra.cmake
99+' Is this need to be modified? This is the install directory!
100+' Our Qt builds are relocatable so it seems like there is no need for modifying it
101+' set(qtbi_orig_staging_prefix "")