Skip to content

Commit

Permalink
Merge pull request #1491 from Framstag/cmake_qt_6_support
Browse files Browse the repository at this point in the history
Add support for Qt 6 or Qt 5 builds using cmake
  • Loading branch information
Framstag committed Aug 30, 2023
2 parents 32bc655 + f13117d commit 1a0b3ae
Show file tree
Hide file tree
Showing 26 changed files with 456 additions and 264 deletions.
40 changes: 38 additions & 2 deletions .github/workflows/build_and test_on_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,44 @@ jobs:
- name: Install build tool
run: brew install cmake ninja
- name: Install dependencies
run: brew install openjdk protobuf protobuf-c qt5 cairo libxml2 gettext pango glfw3 glew glm pkgconfig
run: brew install openjdk
- name: Activate XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
host: 'mac'
target: 'ios'
arch: 'ios'
install-deps: 'true'
cache: true
cache-key-prefix: ${{ runner.os }}
setup-python: false
- name: Dump Qt installation data
run: echo ${Qt5_DIR}
- name: List Qt installation
run: ls -l ../Qt/5.15.2/ios/
- name: List Qt installation
run: ls -l ../Qt/5.15.2/ios/lib/cmake/Qt5
- name: Configure build project
run: cmake -B build -DCMAKE_TOOLCHAIN_FILE=../cmake/iOS.cmake -DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config -DCMAKE_UNITY_BUILD=ON -Wno-dev
run: "cmake -B build
-DCMAKE_SYSTEM_NAME=iOS
-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_OSX_DEPLOYMENT_TARGET=13
-DOSMSCOUT_BUILD_IMPORT=OFF
-DOSMSCOUT_BUILD_GPX=ON
-DOSMSCOUT_BUILD_DEMOS=OFF
-DOSMSCOUT_BUILD_TOOL_DUMPDATA=OFF
-DOSMSCOUT_BUILD_DOC_API=OFF
-DOSMSCOUT_BUILD_WEBPAGE=OFF
-DOSMSCOUT_BUILD_TESTS=OFF
-DQt5_DIR=${Qt5_DIR}/lib/cmake/Qt5
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ON
-DCMAKE_UNITY_BUILD=ON
-Wno-dev"
- name: Build project
run: cmake --build build
6 changes: 4 additions & 2 deletions .github/workflows/build_and test_on_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Configure build project
run: meson setup --buildtype debugoptimized --unity on debug -Dopenmp=false
env:
PKG_CONFIG_PATH: "/usr/local/opt/qt/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig"
PKG_CONFIG_PATH: "/usr/local/opt/qt@5/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig"
- name: Build project
run: meson compile -C debug
- name: Execute tests
Expand All @@ -41,7 +41,9 @@ jobs:
- name: Install dependencies
run: brew install openjdk protobuf protobuf-c qt5 cairo libxml2 gettext pango glfw3 glew glm pkgconfig
- name: Configure build project
run: cmake -B build -DCMAKE_PREFIX_PATH=/usr/local/opt/qt -DCMAKE_UNITY_BUILD=ON -Wno-dev -G "Ninja"
run: cmake -B build -DQt5_DIR=$(brew --prefix qt5)/lib/cmake/Qt5 -DCMAKE_UNITY_BUILD=ON -Wno-dev -G "Ninja"
env:
PKG_CONFIG_PATH: "/usr/local/opt/qt@5/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig"
- name: Build project
run: cmake --build build
- name: Run tests
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/build_and test_on_ubuntu_22_04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,34 @@ jobs:
run: ninja -C debug
- name: Run tests
run: meson test -C debug --print-errorlogs

build_gcc_cmake_qt6:
name: gcc and cmake with Qt6
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install software-properties-common
run: sudo apt-get install software-properties-common
- name: Install gcc compiler, cmake and ninja
run: sudo apt-get -y install gcc-12 g++-12 libtbb-dev ccache libtool pkg-config cmake ninja-build
- name: Install libosmscout dependencies
run: "sudo apt-get update && sudo apt-get install -y
libfreetype6-dev libcairo2-dev libpangocairo-1.0-0 libpango1.0-dev
qmake6 libqt6svg6-dev libqt6core5compat6-dev qt6-declarative-dev qt6-positioning-dev qt6-tools-dev-tools
qt6-l10n-tools qt6-tools-dev qt6-multimedia-dev
libgl-dev"
- name: Configure build project
run: cmake -B build -DCMAKE_UNITY_BUILD=ON -Wno-dev -G "Ninja"
env:
CXX: g++-12
CC: gcc-12
- name: Build project
run: cmake --build build
- name: Install project
run: sudo cmake --install build
- name: Run tests
run: xvfb-run ctest -j 2 --output-on-failure
env:
QT_QPA_PLATFORM: offscreen
working-directory: build
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,21 @@ jobs:
run: ${ANDROID_HOME}/tools/bin/sdkmanager --update
- name: Install android platform, platform-tools, build-tools and ndk
run: ${ANDROID_HOME}/tools/bin/sdkmanager --install "platform-tools" "platforms;android-29" "build-tools;29.0.2" "ndk;23.1.7779620"
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v3
with:
version: '5.12.9'
version: '5.15.2'
host: 'linux'
target: 'android'
arch: 'android_arm64_v8a'
modules: android
arch: 'android'
install-deps: 'true'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
cache: true
cache-key-prefix: ${{ runner.os }}
setup-python: false
- name: Dump Qt installation data
run: echo ${Qt5_DIR}
- name: List Qt installation
run: ls -l ../Qt/5.12.9/android_arm64_v8a/
run: ls -l ../Qt/5.15.2/android/
- name: Configure build project
run: "cmake -B build
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/23.1.7779620/build/cmake/android.toolchain.cmake
Expand Down
1 change: 1 addition & 0 deletions BasemapImport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ endif()

install(TARGETS BasemapImport
RUNTIME DESTINATION bin
BUNDLE DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
Loading

0 comments on commit 1a0b3ae

Please sign in to comment.