Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Aug 4, 2023
1 parent 5fa82fa commit b2976b3
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 129 deletions.
37 changes: 10 additions & 27 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
include:
- TRIPLET: 'arm-android'
- TRIPLET: 'amd64-android'
- TRIPLET: 'arm64-android'

runs-on: macos-12
env:
Expand All @@ -36,7 +36,6 @@ jobs:
QT_ARCH: "android"
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
VCPKG_BASELINE: "d765306b074717dea8dc1c4723e1b025acb61c2d" # use scripts/update_vcpkg_base.bash to change
CACHE_VERSION: 1

steps:
- uses: actions/checkout@v3
Expand All @@ -61,7 +60,6 @@ jobs:
with:
ndk-version: ${{ env.NDK_VERSION_FULL }}
add-to-path: true
local-cache: true

- name: Set up JDK
uses: actions/setup-java@v2
Expand All @@ -85,8 +83,6 @@ jobs:
dir: ${{ github.workspace }}
target: android
arch: ${{ matrix.qt_arch }}
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-v3-${{ env.QT_VERSION }}-android

- name: Install Qt (desktop)
uses: jurplel/install-qt-action@v3
Expand All @@ -96,16 +92,7 @@ jobs:
modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools'
dir: ${{ github.workspace }}
target: desktop
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-v3-${{ env.QT_VERSION }}-desktop

- name: Restore vcpkg folder
id: cache-vcpkg-restore
if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master
uses: actions/cache/restore@v3
with:
path: ${{ env.VCPKG_ROOT }}
key: VCPKG-${{ runner.os }}-${{ matrix.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }}
set-env: false

- name: Get vcpkg
if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true'
Expand All @@ -121,10 +108,16 @@ jobs:
echo "install vcpkg"
chmod +x ./bootstrap-vcpkg.sh
./bootstrap-vcpkg.sh
./vcpkg --version
- name: Build Deps
run: |
echo ${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos
echo "Qt6_HOST_Dir=${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos" >> $GITHUB_ENV
echo "PATH=${{ env.VCPKG_ROOT }}:$PATH" >> $GITHUB_ENV
./vcpkg --version
ls -l ${Qt6_HOST_Dir}/../
mkdir -p ${{ github.workspace }}/build
cd ${{ github.workspace }}/build
cmake -B ${{ github.workspace }}/build/${{ matrix.arch }} \
Expand All @@ -138,9 +131,7 @@ jobs:
-D ANDROID_SDK_ROOT=${ANDROID_HOME} \
-D ANDROID_NDK_VERSION="${{ env.NDK_VERSION }}" \
-D ANDROID_BUILD_TOOLS_VERSION="${ANDROID_BUILD_TOOLS_VERSION}" \
-D CMAKE_PREFIX_PATH=${Qt6_DIR} \
-D QT_HOST_PATH=${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos \
-D QT_HOST_PATH_CMAKE_DIR:PATH=${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos \
-D CMAKE_PREFIX_PATH=${Qt6_DIR}
-DCMAKE_MAKE_PROGRAM=ninja
- name: Upload build logs on deps failure
Expand All @@ -151,14 +142,6 @@ jobs:
path: |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
- name: Save vcpkg folder
uses: actions/cache/save@v3
if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too
id: cache-vcpkg-save
with:
path: ${{ env.VCPKG_ROOT }}
key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }}

- name: Build Test App
run: |
cd ${{ github.workspace }}/build/${{ matrix.arch }}
Expand Down
29 changes: 8 additions & 21 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
QT_ARCH: "ios"
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
VCPKG_BASELINE: "d765306b074717dea8dc1c4723e1b025acb61c2d" # use scripts/update_vcpkg_base.bash to change
CACHE_VERSION: 1

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -55,8 +54,6 @@ jobs:
dir: ${{ github.workspace }}
target: ${{ env.QT_ARCH }}
arch: ${{ matrix.qt_arch }}
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-ios

- name: Install Qt (desktop)
uses: jurplel/install-qt-action@v3
Expand All @@ -66,16 +63,7 @@ jobs:
modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools'
dir: ${{ github.workspace }}
target: desktop
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-desktop

- name: Restore vcpkg folder
id: cache-vcpkg-restore
if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master
uses: actions/cache/restore@v3
with:
path: ${{ env.VCPKG_ROOT }}
key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }}
set-env: false

- name: Get vcpkg
if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true'
Expand All @@ -97,6 +85,13 @@ jobs:
run: |
mkdir -p ${{ github.workspace }}/build
cd ${{ github.workspace }}/build
echo "Qt6_HOST_Dir=${{ github.workspace }}/Qt/${{ env.QT_VERSION }}/macos" >> $GITHUB_ENV
echo "PATH=${{ env.VCPKG_ROOT }}:$PATH" >> $GITHUB_ENV
./vcpkg --version
ls -l ${Qt6_HOST_Dir}/../
cmake -B ${{ github.workspace }}/build \
-S ${{ github.workspace }}/input-sdk \
-DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \
Expand All @@ -121,14 +116,6 @@ jobs:
path: |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
- name: Save vcpkg folder
uses: actions/cache/save@v3
if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too
id: cache-vcpkg-save
with:
path: ${{ env.VCPKG_ROOT }}
key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }}

- name: Build Test App
run: |
cd ${{ github.workspace }}/build
Expand Down
29 changes: 5 additions & 24 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
QT_ARCH: "desktop"
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
VCPKG_BASELINE: "d765306b074717dea8dc1c4723e1b025acb61c2d" # use scripts/update_vcpkg_base.bash to change
CACHE_VERSION: 1

steps:
- uses: actions/checkout@v3
Expand All @@ -48,16 +47,6 @@ jobs:
setup-python: 'false'
modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools'
dir: ${{ github.workspace }}
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-v2-${{ env.QT_VERSION }}-lnx

- name: Restore vcpkg folder
id: cache-vcpkg-restore
if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master
uses: actions/cache/restore@v3
with:
path: ${{ env.VCPKG_ROOT }}
key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }}

- name: Get vcpkg
if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true'
Expand All @@ -74,15 +63,15 @@ jobs:
chmod +x ./bootstrap-vcpkg.sh
./bootstrap-vcpkg.sh
./vcpkg --version
- name: Build Deps
run: |
echo "PATH=${{ env.VCPKG_ROOT }}:$PATH" >> $GITHUB_ENV
which vcpkg
mkdir -p ${{ github.workspace }}/build
cd ${{ github.workspace }}/build
echo "PATH=${{ env.VCPKG_ROOT }}:$PATH" >> $GITHUB_ENV
./vcpkg --version
cmake -B ${{ github.workspace }}/build \
-S ${{ github.workspace }}/input-sdk \
-DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \
Expand All @@ -100,14 +89,6 @@ jobs:
path: |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
- name: Save vcpkg folder
uses: actions/cache/save@v3
if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too
id: cache-vcpkg-save
with:
path: ${{ env.VCPKG_ROOT }}
key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }}

- name: Build Test App
run: |
cd ${{ github.workspace }}/build
Expand Down
25 changes: 4 additions & 21 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,12 @@ jobs:
target: ${{ env.QT_ARCH }}
dir: ${{ github.workspace }}
modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools'
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-v1-${{ env.QT_VERSION }}-mac

- name: Setup compiler
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XC_VERSION }}

- name: Restore vcpkg folder
id: cache-vcpkg-restore
if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master
uses: actions/cache/restore@v3
with:
path: ${{ env.VCPKG_ROOT }}
key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }}

- name: Get vcpkg
if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true'
shell: bash
Expand All @@ -83,11 +73,12 @@ jobs:
- name: Build Deps
run: |
echo "PATH=${{ env.VCPKG_ROOT }}:$PATH" >> $GITHUB_ENV
which vcpkg
mkdir -p ${{ github.workspace }}/build
cd ${{ github.workspace }}/build
echo "PATH=${{ env.VCPKG_ROOT }}:$PATH" >> $GITHUB_ENV
./vcpkg --version
cmake -B ${{ github.workspace }}/build \
-S ${{ github.workspace }}/input-sdk \
-DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" \
Expand All @@ -106,14 +97,6 @@ jobs:
path: |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
- name: Save vcpkg folder
uses: actions/cache/save@v3
if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too
id: cache-vcpkg-save
with:
path: ${{ env.VCPKG_ROOT }}
key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }}

- name: Build Test App
run: |
cd ${{ github.workspace }}/build
Expand Down
22 changes: 2 additions & 20 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
QT_ARCH: "win64_msvc2019_64"
VCPKG_BASELINE: "2f6176ce98fee807a207dc9e8fec213f111c291b" # use scripts/update_vcpkg_base.bash to change
VCPKG_ROOT: "C:/vcpkg-root" # Looks like there is more space on C: than on D: drive (~14GB)
CACHE_VERSION: 1


steps:
- uses: actions/checkout@v3
with:
Expand All @@ -51,16 +50,6 @@ jobs:
arch: ${{ env.QT_ARCH }}
dir: ${{ github.workspace }}
modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools'
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-v1-${{ env.QT_VERSION }}-win

- name: Restore vcpkg folder
id: cache-vcpkg-restore
if: ${{ github.ref != 'refs/heads/master' }} # do not use cache on master
uses: actions/cache/restore@v3
with:
path: ${ env.VCPKG_ROOT }
key: VCPKG-${{ runner.os }}-${{ env.TRIPLET }}-v${{ env.CACHE_VERSION }}-ref-${{ github.ref }}

- name: Get vcpkg
if: steps.cache-vcpkg-restore.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -95,6 +84,7 @@ jobs:
if ($LastExitCode -ne 0) { exit $LastExitCode }
}
$env:PATH="$env:VCPKG_ROOT;$env:PATH"
cd $env:GITHUB_WORKSPACE
mkdir ${{ github.workspace }}\build -ea 0
exec {
Expand All @@ -116,14 +106,6 @@ jobs:
path: |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
- name: Save vcpkg folder
uses: actions/cache/save@v3
if: always() && ${{ github.ref != 'refs/heads/master' }} # do not use cache on master; save on error too
id: cache-build-save
with:
path: ${{ env.VCPKG_ROOT }}
key: ${{ steps.cache-vcpkg-restore.outputs.cache-primary-key }}

- name: Build Test App
shell: pwsh
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ TODO
```
mkdir -p build/x64
cd build/x64
export Qt6_DIR=/opt/Qt/6.5.2/macos;export PATH=$(brew --prefix flex):$(brew --prefix bison)/bin:$(brew --prefix gettext)/bin:$PATH
export Qt6_Dir=/opt/Qt/6.5.2/macos;export PATH=$(brew --prefix flex):$(brew --prefix bison)/bin:$(brew --prefix gettext)/bin:$PATH
cmake -B . -S ../../input-sdk/ \
-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake \
Expand Down
43 changes: 35 additions & 8 deletions vcpkg-overlay/ports/qt6/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ set(QT_MODULES
Qt6Concurrent
Qt6Core
Qt6Core5Compat
Qt6CoreTools # only on desktops
Qt6LinguistTools # only on desktops
Qt6WidgetsTools # only on desktops
Qt6GuiTools # only on desktops
Qt6Designer
Qt6Gui
Qt6Help
Qt6HostInfo
Expand Down Expand Up @@ -62,18 +57,50 @@ set(QT_MODULES
Qt6Xml
)

set(Qt6_DIR $ENV{Qt6_DIR}/lib/cmake)
if(NOT VCPKG_TARGET_IS_IOS)
set(QT_MODULES ${QT_MODULES} Qt6Designer)
endif()


set(Qt6_DIR $ENV{Qt6_Dir}/lib/cmake)

if(EXISTS ${Qt6_DIR})
MESSAGE("Using Qt6_DIR: ${Qt6_DIR}")
else()
MESSAGE(FATAL_ERROR "Qt6 installation not found: ${Qt6_DIR}; Do you have Qt6_DIR environment variable set?")
MESSAGE(FATAL_ERROR "Qt6 installation not found: ${Qt6_DIR}; Do you have Qt6_Dir environment variable set?")
endif()

foreach(MOD ${QT_MODULES})
set(${MOD}_DIR ${Qt6_DIR}/${MOD})
if(NOT EXISTS ${Qt6_DIR}/${MOD})
MESSAGE(FATAL_ERROR "Qt6 ${MOD} not found: ${Qt6_DIR}/${MOD}; Do you have Qt6_DIR environment variable set?")
MESSAGE(FATAL_ERROR "Qt6 ${MOD} not found: ${Qt6_DIR}/${MOD}")
endif()
endforeach()

### HOST
# These modules are not in iOS/Android Qt, but they are needed for Qt
set(QT_HOST_MODULES
Qt6CoreTools
Qt6LinguistTools
Qt6WidgetsTools
Qt6GuiTools
)

if(VCPKG_TARGET_IS_IOS OR VCPKG_TARGET_IS_ANDROID)
set(Qt6_HOST_DIR $ENV{Qt6_HOST_Dir}/lib/cmake)
if(EXISTS ${Qt6_HOST_DIR})
MESSAGE("Using Qt6_HOST_DIR: ${Qt6_HOST_DIR}")
else()
MESSAGE(FATAL_ERROR "Qt6 HOST installation not found: ${Qt6_HOST_DIR}; Do you have Qt6_HOST_Dir environment variable set (on android/iOS)?")
endif()
else()
set(Qt6_HOST_DIR ${Qt6_DIR})
endif()

foreach(MOD ${QT_HOST_MODULES})
set(${MOD}_DIR ${Qt6_HOST_DIR}/${MOD})
if(NOT EXISTS ${Qt6_HOST_DIR}/${MOD})
MESSAGE(FATAL_ERROR "Qt6 HOST ${MOD} not found: ${Qt6_HOST_DIR}/${MOD}")
endif()
endforeach()

Expand Down
Loading

0 comments on commit b2976b3

Please sign in to comment.