jurplel / install-qt-action

Install Qt on your Github Actions workflows with just one simple action
MIT License
473 stars 81 forks source link

Qt5Script is not found #84

Closed moesay closed 3 years ago

moesay commented 3 years ago

I'm building a project that uses QScriptEngine that indeed needs Qt::Script to be linked. The Project. I have done it "locally" and everything is fine by just installing Qt5. Now I'm trying to set up a GitHub workflow but CMake is always failing.

The CMake lines for finding and linking QtScript

find_package(Qt5 COMPONENTS Widgets Script REQUIRED)
target_link_libraries(Elegant86 Qt5::Widgets Qt5::Script)

And the workflow code is

name: CMake

on: [push]

env:
  BUILD_TYPE: Release

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - run: sudo apt-get install g++-10

    - name: Install Qt
      uses: jurplel/install-qt-action@v2
      with:
        version: 5.14.2

    - run: sudo apt-get install qtscript5-dev
    - name: Create Build Environment
      run: cmake -E make_directory ${{github.workspace}}/build

    - name: Configure CMake
      shell: bash
      env:
        CXX: g++-10

      working-directory: ${{github.workspace}}/build
      run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE

    - name: Build
      working-directory: ${{github.workspace}}/build
      shell: bash
      run: cmake --build . --config $BUILD_TYPE

    - name: Test
      working-directory: ${{github.workspace}}/build
      shell: bash
      run: ctest -C $BUILD_TYPE

The workflow always fails with this error message

CMake Error at /home/runner/work/Elegant86/Qt/5.14.2/gcc_64/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5Script" with
-- Configuring incomplete, errors occurred!
  any of the following names:
See also "/home/runner/work/Elegant86/Elegant86/build/CMakeFiles/CMakeOutput.log".

Why even after "presumably" installing Qt 5.14.2, the version i have locally, CMake can't find QScript? I have even tried to do - run: sudo apt-get install qtscript5-dev but it still not working.

jurplel commented 3 years ago

Hello, You'll need to add modules: 'qtscript' to install-qt-action's parameters.

moesay commented 3 years ago

@jurplel

Hello, You'll need to add modules: 'qtscript' to install-qt-action's parameters.

That Solves the problem! Thanks

jurplel commented 3 years ago

Sure thing, good luck!