diff --git a/.github/actions/qt6-build/entrypoint.sh b/.github/actions/qt6-build/entrypoint.sh index 9384f3aac..8dfd07c36 100755 --- a/.github/actions/qt6-build/entrypoint.sh +++ b/.github/actions/qt6-build/entrypoint.sh @@ -18,3 +18,5 @@ qt-cmake ../source/ \ -DMBGL_QT_LIBRARY_ONLY=ON ninja ninja install +cd ../install +ln -s lib64 lib diff --git a/.github/workflows/qt-ci.yml b/.github/workflows/qt-ci.yml index b3b467a0b..6ab1b9f07 100644 --- a/.github/workflows/qt-ci.yml +++ b/.github/workflows/qt-ci.yml @@ -236,11 +236,65 @@ jobs: name: maplibre-gl-native_${{ matrix.name }}_Qt${{ matrix.qt_version }} path: maplibre-gl-native_${{ matrix.name }}_Qt${{ matrix.qt_version }}.tar.bz2 + test-tarball: + needs: build + strategy: + matrix: + include: + - name: Linux + os: ubuntu-22.04 + qt_version: 6.4.0 + qt_target: desktop + - name: macOS + os: macos-12 + qt_version: 6.4.0 + qt_target: desktop + runs-on: ${{ matrix.os }} + env: + QT_ARCH: ${{ matrix.name }} + QT_VERSION: ${{ matrix.qt_version }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: source + fetch-depth: 0 + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: maplibre-gl-native_${{ matrix.name }}_Qt${{ matrix.qt_version }} + + - name: Download Qt + uses: jurplel/install-qt-action@v3 + with: + aqtversion: ==2.1.* + version: ${{ env.QT_VERSION }} + dir: ${{ github.workspace }} + target: ${{ matrix.qt_target }} + + - name: Setup Xcode + if: runner.os == 'macOS' + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Build test app + run: | + mkdir install && cd install + tar xf ../maplibre-gl-native_${QT_ARCH}_Qt${QT_VERSION}.tar.bz2 + cd .. + export CMAKE_PREFIX_PATH=$PWD/install + mkdir build && cd build + cmake ../source/platform/qt/app/ + make + release: name: Release QMapLibreGL if: github.ref_type == 'tag' runs-on: ubuntu-22.04 - needs: build + needs: test-tarball strategy: max-parallel: 1 matrix: diff --git a/platform/qt/app/CMakeLists.txt b/platform/qt/app/CMakeLists.txt new file mode 100644 index 000000000..48497ed13 --- /dev/null +++ b/platform/qt/app/CMakeLists.txt @@ -0,0 +1,30 @@ +# minimal CMakeLists.txt for QMapLibreGL usage +cmake_minimum_required(VERSION 3.16) + +project(hellomaplibre VERSION 1.0.0 LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +if(APPLE) # suppress some warnings in Qt6 + set(CMAKE_CXX_VISIBILITY_PRESET hidden) +endif() + +find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGLWidgets Widgets) +qt_standard_project_setup() + +find_package(QMapLibreGL REQUIRED) + +add_executable(hellomaplibre + main.cpp + mapwindow.cpp + mapwindow.hpp +) + +target_link_libraries(hellomaplibre + PRIVATE + Qt6::Core + Qt6::Gui + Qt6::OpenGLWidgets + Qt6::Widgets + QMapLibreGL +)