Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Automatic installation for Travis CI (or any other CI)
Forum Updated to NodeBB v4.3 + New Features

Automatic installation for Travis CI (or any other CI)

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jozef Mlich
    wrote on last edited by
    #1

    What is recommended way to install Qt in Windows based CI? Will it be working with future versions?

    Auto-depoying guide suggests AppVeyor CI but it doesn't include install of Qt.

    Chocolatey Qt packages seems to be outdated https://chocolatey.org/search?q=Qt

    Wireshark has dropped windows from its tests https://github.com/wireshark/wireshark/commit/44407c16fcf085b811caf5bc33c7667b2b354fc6#diff-354f30a63fb0907d4ad57269548329e3

    And other projects are including Qt Account credentials into public git repository https://github.com/semlanik/qtprotobuf/

    There is also Another Qt installer(aqt) https://github.com/miurahr/aqtinstall . It looks as best solution so far. Would you recommend something else?

    1 Reply Last reply
    1
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      Travis CI - Ubuntu:

      Stephan Binner is your best friend. Add the relevant ppa to your sources and you can use apt-get to install Qt.
      Example:

      matrix:
        fast_finish: true
        include:
        - name: Ubuntu Build
          os: linux
          dist: bionic
          group: stable
          services:
              - xvfb
          compiler: gcc
          addons:
            apt:
              sources:
              - ubuntu-toolchain-r-test
              - sourceline: 'ppa:beineri/opt-qt-5.14.2-bionic'
              update: true
              packages:
              - qt514base
              - qt514tools
              - gcc-9
              - g++-9
              - libc6-i386
              - libgl-dev
              - libgl1-mesa-dev
              - mesa-common-dev
          script:
              - /opt/qt514/bin/qt514-env.sh
              - CXX="g++-9"
              - CC="gcc-9"
              - mkdir ./build
              - cd ./build
              - cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE ../
              - cmake --build .
      

      Travis - MacOS

      Homebrew
      Example:

        - name: MacOS
          os: osx
          osx_image: xcode11.3
          compiler: clang
          addons:
            homebrew:
              packages:
              - qt
              update: true
          script:
              - mkdir ./build
              - cd ./build
              - cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE ../
              - cmake --build .
      

      Appveyor - Windows

      Qt comese pre-installed
      Example:

      before_build:
      - set SOURCEDIR=%cd%
      - call "C:\Qt\5.13\msvc2017\bin\qtenv2.bat"
      - cd /D %SOURCEDIR%
      - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
      build_script:
      - mkdir .\build 
      - cd .\build
      - cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=RELEASE ../
      - cmake --build .
      

      You can use these 2 scripts I am using as full examples: Appveyor/Travis CI

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      J 1 Reply Last reply
      1
      • VRoninV VRonin

        Travis CI - Ubuntu:

        Stephan Binner is your best friend. Add the relevant ppa to your sources and you can use apt-get to install Qt.
        Example:

        matrix:
          fast_finish: true
          include:
          - name: Ubuntu Build
            os: linux
            dist: bionic
            group: stable
            services:
                - xvfb
            compiler: gcc
            addons:
              apt:
                sources:
                - ubuntu-toolchain-r-test
                - sourceline: 'ppa:beineri/opt-qt-5.14.2-bionic'
                update: true
                packages:
                - qt514base
                - qt514tools
                - gcc-9
                - g++-9
                - libc6-i386
                - libgl-dev
                - libgl1-mesa-dev
                - mesa-common-dev
            script:
                - /opt/qt514/bin/qt514-env.sh
                - CXX="g++-9"
                - CC="gcc-9"
                - mkdir ./build
                - cd ./build
                - cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE ../
                - cmake --build .
        

        Travis - MacOS

        Homebrew
        Example:

          - name: MacOS
            os: osx
            osx_image: xcode11.3
            compiler: clang
            addons:
              homebrew:
                packages:
                - qt
                update: true
            script:
                - mkdir ./build
                - cd ./build
                - cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE ../
                - cmake --build .
        

        Appveyor - Windows

        Qt comese pre-installed
        Example:

        before_build:
        - set SOURCEDIR=%cd%
        - call "C:\Qt\5.13\msvc2017\bin\qtenv2.bat"
        - cd /D %SOURCEDIR%
        - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat"
        build_script:
        - mkdir .\build 
        - cd .\build
        - cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=RELEASE ../
        - cmake --build .
        

        You can use these 2 scripts I am using as full examples: Appveyor/Travis CI

        J Offline
        J Offline
        Jozef Mlich
        wrote on last edited by
        #3

        @VRonin I ended up with following .travis.yml

        os: windows
        language: C++
        env: PATH=/c/Python38:/c/Python38/Scripts:$PATH
        before_install:
        #  - choco install -y visualstudio2017buildtools
        #  - choco install -y visualstudio2017-workload-vctools
          - choco install  python --version 3.8.0
          - python -m pip install --upgrade pip
          - python -m pip install aqtinstall
          - python -m aqt install --outputdir /c/Qt 5.14.2 windows desktop win32_msvc2017
        script:
          - mkdir build
          - cd build
          - cmake -DCMAKE_PREFIX_PATH="C:\Qt\5.14.2\msvc2017" -DCMAKE_BUILD_TYPE=RELEASE -DDEPLOY_QT_LIBRARIES=ON ..
          - cmake --build .
          - cp *.qm ./Debug
          - 7z a -tzip editor.zip -r *
        deploy:
          provider: releases
          skip_cleanup: true
          api_key: $GITHUB_TOKEN
          file: editor.zip
          on:
            tags: false
            draft: true
        
        
        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved